How to create a splash screen on Qt?

自古美人都是妖i 提交于 2020-11-27 01:52:48

问题


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:


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()));


来源:https://stackoverflow.com/questions/41339196/how-to-create-a-splash-screen-on-qt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!