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. Qt Splash screen won't disappear

Qt Splash screen won't disappear

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 760 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
    BokJr
    wrote on last edited by
    #1

    Hi all,

    I have created a splash screen image to show on running of the application I have tried to set it to a timer to automatically disappear but it just stays on screen until i click the centre of the splash screen then it disappears.

    can anyone help me? I'm a complete newbie to Qt

    @#include "mainwindow.h"
    #include <QApplication>
    #include <QSplashScreen>
    #include <QTimer>
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    QSplashScreen *splash=new QSplashScreen;
    splash->setPixmap(QPixmap("/Users/Marcus/Calc/Images/Optics.jpg"));
    splash->show();
    
    MainWindow w;
    
    QTimer::singleShot(2500,splash,SLOT(close()));
    QTimer::singleShot(2500,splash,SLOT(show()));
    w.show();
    
    return a.exec&#40;&#41;;
    

    }
    @

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Remove line 16. and it should work fine.

      (Z(:^

      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