From bcfacd4b6f35dfd00f0f04d562f345bbc98cec13 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 24 Oct 2014 19:33:30 +0200 Subject: Make sure the QSplashScreen isn't closed instantly when calling finish() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Alex Blasche --- src/widgets/widgets/qsplashscreen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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(); } -- cgit v1.2.3