Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT-Splash screen [ Solved ]
Qt 6.11 is out! See what's new in the release blog

QT-Splash screen [ Solved ]

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 6.1k 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.
  • S Offline
    S Offline
    Slyvr
    wrote on last edited by
    #1

    I am using qt 4.5.3 and i want to create a splash screen that disappears after ~5 seconds. i tried using sleep and other such structures, the splash screen activates and disappears on time but the image in the splash doesn't load, like in the case without the timer/sleep. Here is my code from the main.cpp, If anyone has any suggestions please help me out, :

    @
    /*

    • main.cpp
    • Created on: May 24, 2012
    •  Author: f-time
      

    */

    #include <QApplication>
    #include <QSplashScreen>
    #include<time.h>
    #include<iostream>
    #include "mainwindow.h"

    using namespace std;

    int main(int argc, char *argv[])
    {
    // Q_INIT_RESOURCE(application);
    QApplication app(argc, argv);
    QPixmap pixmap("splash.jpg");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    app.processEvents();
    app.setOrganizationName("Boss");
    app.setApplicationName("Can Application");
    MainWindow mainWin;

     mainWin.show();
    
    
     splash->finish(&mainWin);
     return app.exec(&#41;;
    

    }
    @

    [Edit: Be sure and wrap your code in @ tags; mlong]

    Came here to code and drink coffee... And I'm all out of coffee...

    1 Reply Last reply
    0
    • K Offline
      K Offline
      KA51O
      wrote on last edited by
      #2

      Maybe "this code":https://qt-project.org/forums/viewthread/10075/ I posted a while ago is helpful to you.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Slyvr
        wrote on last edited by
        #3

        Thank you. That bit of code just did the trick! and prompt answer too ^^

        Came here to code and drink coffee... And I'm all out of coffee...

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KA51O
          wrote on last edited by
          #4

          Glad I could help. Please edit the title of this thread by editing your first post in this thread and add [Solved] to the title. Thank you.

          1 Reply Last reply
          0

          • Login

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