Qt设置启动页面

发布时间 2023-03-27 16:16:24作者: 远方是什么样子

 

#include <QSplashScreen>

QPixmap pixmap(":/Resources/login.png");
QSplashScreen splash(pixmap);
splash.show();
 
//设置显示信息
splash.showMessage("程序初始化中...", Qt::AlignLeft | Qt::AlignBottom, QColor(255, 255, 255));

QWidget* w = new Widget(this);
w->show();
splash.finish(w);//程序启动画面结束