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();
}

 

posted @ 2013-01-07 13:22  wiessharling  阅读(186)  评论(0编辑  收藏  举报