Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119225

[Reg 6.2 -> 6.5] QSplashScreen no longer shows on Linux with a single call to QCoreApplication::processEvents()

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              axelspoerl Axel Spoerl
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes