Qt程序启动画面

代码如下:

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QSplashScreen *splash=new QSplashScreen;
    splash->setPixmap(QPixmap(":/Game.jpg"));
    splash->show();

    Qt::Alignment topRight=Qt::AlignRight|Qt::AlignTop;
    splash->showMessage(QObject::tr("Setting up the application..."),topRight,Qt::white);

    MainWindow w;
    splash->showMessage(QObject::tr("Loading the modules..."),topRight,Qt::white);
//    loadModules();
    splash->showMessage(QObject::tr("Establing the connection..."),topRight,Qt::white);
    w.show();
    splash->finish(&w);
    delete splash;
    return a.exec();
}
原文地址:https://www.cnblogs.com/wiessharling/p/2849123.html