How to create a splash screen on Qt?

前端 未结 1 607
后悔当初
后悔当初 2021-01-06 09:09

I want to create a simple splash screen for my Qt application. I\'m learning how to create Qt application and have little knowledge. Any help would be gladly appreciated!

相关标签:
1条回答
  • 2021-01-06 09:51

    I recently created this splash screen, I think you can use it. Make sure to add this in main.cpp

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap("/PATH/splash.jpg")); // splash picture
    splash->show();
    
    MainWindow w;
    
     QTimer::singleShot(2500, splash,SLOT(close())); // Timer
     QTimer::singleShot(2500,&w,SLOT(show()));
    
    0 讨论(0)
提交回复
热议问题