int main(int argc,char **argv)
{
QApplication app(argc,argv);
app.setStyle("plastique");
QSplashScreen *splash=new QSplashScreen;
splash->setPixmap(QPixmap(":/Images/splash.png")); // 设置splash图片。
MainWindow *mainWin=new MainWindow;
splash->show(); // 显示splash。
// *********************************** 重 点 ****************************************
// 重绘splash一千次,虽然方法笨一点却毫无任何影响。
for(int i=0;i<1000;i++)
{
splash->repaint();
}
// *************************************************************************************
mainWin->show();
splash->finish(mainWin);
delete splash;
return app.exec();
}
其实 qt 对同一问题的解决方法有很多,遇到难题时,换换思考角度或许也有不错的收获哦。
<quote> " 在windows下不能使用sleep函数的。在linux下面是可以的 " </quote>
不是吧!