Details
-
Bug
-
Resolution: Fixed
-
P5: Not important
-
6.5.3
-
Ubuntu 22.04, Wayland display
-
-
7835f9e60 (dev), b41fc4bed (6.7), 87c81931b (6.6), 5fb4fad08 (tqtc/lts-6.5)
-
G&UI Finishing 2023
Description
Code
Adapted from https://doc.qt.io/qt-6/qsplashscreen.html#details
static void doLongAndExpensiveInitialization() { int i = 0; while (i++ < 5) QThread::sleep(1); } int main(int argc, char *argv[]) { QApplication app(argc, argv); QPixmap pixmap(":/splash.png"); QSplashScreen splash(pixmap); splash.show(); app.processEvents(); // app.processEvents(); // WORKAROUND: Call processEvents() twice doLongAndExpensiveInitialization(); QMainWindow window; window.show(); splash.finish(&window); return app.exec(); }
Expected outcomes
When the app is started, the splash screen shows on screen for 5 seconds, and then disappears as the main window appears.
Actual outcomes
When the app is started, nothing shows for 5 seconds, and then the main window appears.
Workaround
Call processEvents() twice instead of once
Notes
- Tested with both -platform xcb and -platform wayland
- This doesn't seem to affect Windows. In fact, Windows shows the splash screen even without any calls to processEvents()
- Qt 6.2.8 did not have this issue
Attachments
Issue Links
- resulted in
-
QTBUG-119332 QSplashScreen documentation showcases bad practices
- Reported
-
QTBUG-119368 Research modern QSplashScreen replacement
- Reported