功能说明:先启用5秒动画效果然后隐藏再启用程序 int main(int argc, char *argv[]) { QTextCodec *codec = QTextCodec::codecForName("system"); //GBK gbkQTextCodec::setCodecForTr(codec); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForCStrings(codec); QApplication a(argc, argv); QString text=QCoreApplication::applicationDirPath()+"/" +"icons"+"/" + "ajax-loader.gif"; QMovie movie(text); QLabel label; label.setGeometry(750, 400, 100, 100); label.setMovie(&movie); label.setWindowFlags(Qt::FramelessWindowHint);//去掉动画界面边框 movie.start(); label.show(); //延迟5秒 QTime t; t.start(); while(t.elapsed() < 5000) { QApplication::processEvents(); } //主界面显示 MainWindow w; w.show(); label.close(); return a.exec(); }
06-24
3517
05-08
1316