- 
    
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
 
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
 
- resulted in
 - 
                    
QTBUG-119332 QSplashScreen documentation showcases bad practices
-         
 - Reported
 
 -         
 - 
                    
QTBUG-119368 Research modern QSplashScreen replacement
-         
     - Reported
 
 -         
 
| For Gerrit Dashboard: QTBUG-119225 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 524302,11 | QSplashScreen: Enforce visibility by processing events | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 525513,2 | QSplashScreen: Enforce visibility by processing events | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 525572,2 | QSplashScreen: Enforce visibility by processing events | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 525617,2 | QSplashScreen: Enforce visibility by processing events | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |