What:
Show a splash image and some message before the main window loading. QTest can sleep process to check the QSplashScreen.
How:
Setup .pro file:
CONFIG += qtestlib
#include
- int main(int argc, char *argv[])
- {
- QApplication app(argc, argv);
- QPixmap pixmap("splash.png");
- QSplashScreen splash(pixmap);
- splash.show();
- splash->showMessage("Loaded modules");
- QTest::qTest(1000); //ms
- QMainWindow window;
- window.show();
- splash.finish(&window);
- return app.exec();
- }
阅读(509) | 评论(0) | 转发(0) |