就拿helloworld来举例:
1:添加头文件:- #include <QSplashScreen>
- #include <QPixmap>
2:添加资源文件qrc,并改前缀为 /
添加文件:splash.png
- QApplication app(argc, argv);
- QPixmap pixmap(":/splash.jpg");
- QSplashScreen splash(pixmap);
- splash.show();
- MainWindow window;
- window.show();
- splash.finish(&window);
- return app.exec();