summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-05-26 13:28:55 +0200
committerMitch Curtis <mitch.curtis@qt.io>2017-05-29 10:35:46 +0000
commita089de0d992072bb06aa35323a53ca6cb5d76557 (patch)
treefa53adcd26e286058d22c5d43d5cc5d71336078e /tests/auto/widgets/kernel
parent8b1377fde16a2049a1c27f6d005bff84a8f85f28 (diff)
Fix tst_QWidget::translucentWidget() on high DPI displays
It was grabbing a QLabel without accounting for the size of the window in the case where the DPI is larger than 1: FAIL! : tst_QWidget::translucentWidget() Compared values are not the same Actual (actual.size()) : QSize(32x32) Expected (expected.size()): QSize(16x16) Change-Id: I4873f3c6364ee2696f5612d91e6c97c60b2cd915 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index e68f0f57ef..0933dc991d 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -8526,8 +8526,8 @@ void tst_QWidget::translucentWidget()
else
#endif
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
- QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
- QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32);
+ const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
+ const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
QCOMPARE(actual.size(),expected.size());
QCOMPARE(actual,expected);
}