summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-23 17:59:49 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-27 14:46:08 +0000
commitd1f924bbce4e0057bdfe3cf3c10140895bec7510 (patch)
tree80e2afb8564f1e567da1277d4389e8580fcc35b0 /tests/auto/widgets
parent4e01b851159342122d42be1091d4cfa464700a4e (diff)
Fix tst_QStyleSheetStyle crash on uncommon multi-screen setup
It would crash if there is no screen at 0,0. Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index f5d9433f70..03f24ba151 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -2085,7 +2085,8 @@ void tst_QStyleSheetStyle::highdpiImages()
QFETCH(QColor, color);
QWidget w;
- QScreen *screen = QGuiApplication::screenAt(w.pos());
+ QScreen *screen = QGuiApplication::primaryScreen();
+ w.move(screen->availableGeometry().topLeft());
QHighDpiScaling::setScreenFactor(screen, screenFactor);
w.setStyleSheet("QWidget { background-image: url(\":/images/testimage.png\"); }");
w.show();