From 81a7344e1dea562271865ddf94a7d7138e663ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 16 Aug 2021 08:41:57 +0200 Subject: Port to QImage and QPixmap deviceIndependentSize() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the “size() / devicePixelRatio()” pattern with a call to deviceIndependentSize(). Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7 Reviewed-by: Qt CI Bot Reviewed-by: Tor Arne Vestbø --- tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp index c9e71d8388..ad4f8e04bc 100644 --- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp +++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp @@ -584,7 +584,7 @@ void tst_QLabel::taskQTBUG_48157_dprPixmap() pixmap.load(QFINDTESTDATA(QStringLiteral("red@2x.png"))); QCOMPARE(pixmap.devicePixelRatio(), 2.0); label.setPixmap(pixmap); - QCOMPARE(label.sizeHint(), pixmap.rect().size() / pixmap.devicePixelRatio()); + QCOMPARE(label.sizeHint(), pixmap.deviceIndependentSize().toSize()); } void tst_QLabel::taskQTBUG_48157_dprMovie() @@ -595,7 +595,7 @@ void tst_QLabel::taskQTBUG_48157_dprMovie() movie.start(); QCOMPARE(movie.currentPixmap().devicePixelRatio(), 2.0); label.setMovie(&movie); - QCOMPARE(label.sizeHint(), movie.currentPixmap().size() / movie.currentPixmap().devicePixelRatio()); + QCOMPARE(label.sizeHint(), movie.currentPixmap().deviceIndependentSize().toSize()); } void tst_QLabel::resourceProvider() -- cgit v1.2.3