QApplication a(argc, argv);
// QPixmap pixmap("1.png");
// QSplashScreen splash(pixmap);
// splash.show();
// a.processEvents(); //是程序在显示启动画面的同时仍能相应鼠标等其他事件
QPixmap pix("2.gif");
QSplashScreen splash(pix);
QLabel splashlabel(&splash);
QMovie splashgif("2.gif");
splashlabel.setMovie(&splashgif);
splashgif.start();
splash.show();
splash.setCursor(Qt::BlankCursor);//不显示鼠标外观
for(int i=0;i<1000;i+=splashgif.speed()){
QCoreApplication::processEvents();
_sleep(splashgif.speed()/5);
}
MainWindow w;
splash.finish(&w);
w.show();
return a.exec();