diff options
author | Andy Shaw <andy.shaw@digia.com> | 2014-10-24 19:33:30 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-02-17 08:27:20 +0000 |
commit | bcfacd4b6f35dfd00f0f04d562f345bbc98cec13 (patch) | |
tree | 8d8778bde7c29bd0c8d7de7f4d1693ba2f880624 /src/widgets/widgets/qsplashscreen.cpp | |
parent | 8d6341a721d07e3cc30032bcc89f7e25cb00b9eb (diff) |
Make sure the QSplashScreen isn't closed instantly when calling finish()
Most of the time the widget passed in to finish() will not yet have a
window handle so it would just call close() straight away. This
way it ensures has a window handle.
Task-number: QTBUG-35757
Change-Id: I2e212a2ea496cc4e4bba57a8c2d0d127afc43e48
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qsplashscreen.cpp')
-rw-r--r-- | src/widgets/widgets/qsplashscreen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index d6b94803d7..30d6baa899 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -262,8 +262,11 @@ inline static bool waitForWindowExposed(QWindow *window, int timeout = 1000) void QSplashScreen::finish(QWidget *mainWin) { - if (mainWin && mainWin->windowHandle()) + if (mainWin) { + if (!mainWin->windowHandle()) + mainWin->createWinId(); waitForWindowExposed(mainWin->windowHandle()); + } close(); } |