aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp2
-rw-r--r--tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp b/src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp
index 8533802a5a..2aa81f68a3 100644
--- a/src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp
+++ b/src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp
@@ -146,7 +146,7 @@ qreal QQuickMaterialPlaceholderText::floatingTargetY() const
// Outlined text fields have the placeaholder vertically centered
// along the outline at the top.
- return (-m_largestHeight / 2) + controlTopInset(textControl());
+ return (-m_largestHeight / 2.0) + controlTopInset(textControl());
}
/*!
diff --git a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml
index aac3bbd832..fb516ec669 100644
--- a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml
+++ b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml
@@ -1070,7 +1070,7 @@ TestCase {
// The placeholder text should always float at a fixed position at the top
// when text has been set, even when it's in a Flickable.
flickable.contentY = -50
- compare(placeholderTextItem.y, -Math.floor(placeholderTextItem.largestHeight / 2))
+ compare(placeholderTextItem.y, -placeholderTextItem.largestHeight / 2)
flickable.contentY = 0
// When the text is cleared, it shouldn't float.