From f783ab6049774888308e24bf6e4218a7035a4d12 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sun, 11 Apr 2021 15:21:41 +0200 Subject: Fix warnings about lossy double/float conversion in tests QColor operates on floats, not qreal or double, so explicitly use float literals in test code. Change-Id: I6f0cb56e861b4812fc79ce67ade9abe3ee9dfddc Reviewed-by: Fabian Kosmale Reviewed-by: David Skoland (cherry picked from commit 8bb955e22f027fc3fd9402383445685cb4185744) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/quick/qquickanimations/tst_qquickanimations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick') diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp index fe366d0f34..072fe38f80 100644 --- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp +++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp @@ -217,7 +217,7 @@ void tst_qquickanimations::simpleColor() QVERIFY(animation.isPaused()); animation.setCurrentTime(125); QCOMPARE(animation.currentTime(), 125); - QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); + QCOMPARE(rect.color(), QColor::fromRgbF(0.498039f, 0, 0.498039f, 1)); rect.setColor(QColor("green")); animation.setFrom(QColor("blue")); @@ -228,7 +228,7 @@ void tst_qquickanimations::simpleColor() QCOMPARE(rect.color(), QColor("blue")); QVERIFY(animation.isRunning()); animation.setCurrentTime(125); - QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); + QCOMPARE(rect.color(), QColor::fromRgbF(0.498039f, 0, 0.498039f, 1)); } void tst_qquickanimations::simpleRotation() -- cgit v1.2.3