#include <QSplashScreen>
#include <QPixmap>
#include <QElapsedTimer>
#include <QDateTime>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPixmap pixmap("loading.gif"); //gif图片不会动态变化
QSplashScreen screen(pixmap);
screen.show();
//screen.showMessage("loading", Qt::AlignCenter, Qt::red);
int delayTime = 5;
QElapsedTimer timer;
timer.start();
while(timer.elapsed() < (delayTime * 1000))
{
app.processEvents();
}
Widget w;
w.show();
screen.finish(&w);
return app.exec();
}
Qt 程序启动画面
最新推荐文章于 2024-09-11 17:54:03 发布