qt程序启动播放动画
1、播放动画
1 QAxWidget *flash = new QAxWidget(0, 0); //QAxWidget使用的是ActiveX插件 2 3 flash->resize(800, 600); //设置该控件的初始大小 4 5 flash->setControl(QString::fromUtf8("{d27cdb6e-ae6d-11cf-96b8-444553540000}")); //设定控制器 6 7 flash->dynamicCall("LoadMovie(long,string)", 0, "D:\\flash1.swf"); // 8 9 flash->setWindowFlags(Qt::FramelessWindowHint); //去除边框 10 11 flash->show(); 12 13 QTime t; 14 15 t.start(); 16 17 while (t.elapsed() < 5000) 18 19 { 20 QApplication::processEvents(); 21 } 22 flash->close();
flash->close();
2、图+消息提示
1 QApplication app(argc, argv); 2 3 QPixmap pixmap(":/splash.png"); 4 5 QSplashScreen splash(pixmap); 6 7 splash.show(); 8 9 splash.showMessage(QStringLiteral("正在初始化..."));//消息提示 10 11 app.processEvents(); 12 13 ... 14 15 QMainWindow window; 16 17 window.show(); 18 19 splash.finish(&window);
时间: 2024-10-15 23:10:50