summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-09-04 17:26:33 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-09-10 07:34:03 +0000
commit49362d064fffe350600f5324fb510b381578d04a (patch)
treef6c250aa4a732f4763e4b9a09ac5696459a83e5c /tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp
parente77877f2079a74918c139b8ea7f6dc927246c20f (diff)
Add a QSplashScreen constructor taking a QScreen
The constructor taking a QWidget is needed for specifying the screen where the splash screen should be displayed. Add a new constructor for specifying the target screen for the splash screen directly, instead of "extracting" the screen information from a widget. This removes the need for using the deprecated QDesktopWidget. Deprecate the constructor taking a QWidget. Task-number: QTBUG-76491 Change-Id: I1dde242ff5f7b53e52af308bb685f492d6266d33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp')
-rw-r--r--tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp b/tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp
index 91a9c49b00..64e4582366 100644
--- a/tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp
+++ b/tests/auto/widgets/widgets/qsplashscreen/tst_qsplashscreen.cpp
@@ -36,6 +36,7 @@ class tst_QSplashScreen : public QObject
private slots:
void checkCloseTime();
+ void checkScreenConstructor();
};
class CloseEventSplash : public QSplashScreen
@@ -69,5 +70,16 @@ void tst_QSplashScreen::checkCloseTime()
QVERIFY(w.windowHandle()->isExposed());
}
+void tst_QSplashScreen::checkScreenConstructor()
+{
+ for (const auto screen : QGuiApplication::screens()) {
+ QSplashScreen splash(screen);
+ splash.show();
+ QCOMPARE(splash.screen(), screen);
+ QVERIFY(splash.windowHandle());
+ QCOMPARE(splash.windowHandle()->screen(), screen);
+ }
+}
+
QTEST_MAIN(tst_QSplashScreen)
#include "tst_qsplashscreen.moc"