代码如下:
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(); }