Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Splash screen not showing messages
Qt 6.11 is out! See what's new in the release blog

Splash screen not showing messages

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    buckler
    wrote on last edited by
    #1

    I can successfully show a splash screen while my application is starting, and it goes away when I want it to. But the messages I want to show do not appear. I have tried both repaint and process events, as in the code below. What am I missing?

    Code:
    @@
    Application a(argc, argv);
    QPixmap pixmap(":/cap/1.6 aspect ratio for splash screen.jpg");
    QSplashScreen splash(pixmap);
    splash.show();
    sleep(1);
    splash.showMessage(QApplication::translate("Setting Product Attributes...", 0), Qt::AlignLeft, Qt::black);
    splash.repaint(); // ensure progress is shown
    qApp->processEvents();
    sleep(2);
    splash.showMessage(QApplication::translate("Confirming Registration...", 0), Qt::AlignLeft, Qt::black);
    splash.repaint(); // ensure progress is shown
    qApp->processEvents();
    sleep(2);
    splash.showMessage(QApplication::translate("Loading Client Application...", 0), Qt::AlignLeft, Qt::black);
    splash.repaint(); // ensure progress is shown
    qApp->processEvents();
    @@

    Of course I will do something ore than just "sleep", but I wanted to get the messages workign before moving further.

    Thank you,
    Andy

    1 Reply Last reply
    0
    • B Offline
      B Offline
      buckler
      wrote on last edited by
      #2

      I didn't get any posts from others, but in the meantime I did get this to work so perhaps posting the solution will be helpful for the list. It turns out - not sure why - that the QApplication::translate calls I was making are ignored by QSplashScreen. I found another post on the forum at https://forum.qt.io/topic/1911/solved-shows-splashscreen-but-does-not-show-its-message, that uses something I had not been aware of, QSplashScreen::tr, instead... and this works!

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved