path: root/src/widgets/doc
diff options
authorSona Kurazyan <>2019-09-04 17:26:33 +0200
committerTor Arne Vestbø <>2019-09-10 07:34:03 +0000
commit49362d064fffe350600f5324fb510b381578d04a (patch)
treef6c250aa4a732f4763e4b9a09ac5696459a83e5c /src/widgets/doc
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ø <>
Diffstat (limited to 'src/widgets/doc')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/doc/snippets/qsplashscreen/main.cpp b/src/widgets/doc/snippets/qsplashscreen/main.cpp
index 843932ca83..2512035879 100644
--- a/src/widgets/doc/snippets/qsplashscreen/main.cpp
+++ b/src/widgets/doc/snippets/qsplashscreen/main.cpp
@@ -71,3 +71,10 @@ int main(int argc, char *argv[])
return app.exec();
//! [1]
+//! [2]
+QScreen *screen = QGuiApplication::screens().at(1);
+QPixmap pixmap(":/splash.png");
+QSplashScreen splash(screen, pixmap);;
+//! [2]