多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 概述 加载图片 ``` QApplication app(argc, argv); QSplashScreen *splash = new QSplashScreen; splash->setPixmap(QPixmap(":/img/1.png")); splash->show(); splash->showMessage( "Creating Widgets Page...",Qt::AlignHCenter | Qt::AlignVCenter,Qt::red);//居中,红色字体 app.processEvents(); //当处理的事件耗时较长时,保证所有事件处理完成后再继续往下执行 QThread::sleep(1); splash->showMessage( "Creating Database Page..." ); app.processEvents(); QThread::sleep(1); splash->showMessage( "Creating Games Page..." ); app.processEvents(); QThread::sleep(1); MainWindow mainwindow; QTimer::singleShot(2500, splash, SLOT(close())); QTimer::singleShot(2500, &mainwindow, SLOT(show())); return app.exec(); ``` 动态图 ``` QApplication a(argc, argv); //===动态程序启动画面=== QPixmap pix(":/resource/splash2.gif"); QSplashScreen splash(pix); QLabel splashlabel(&splash); QMovie splashgif(":/resource/splash2.gif"); splashlabel.setMovie(&splashgif); splashgif.start(); splash.show(); splash.setCursor(Qt::BlankCursor);//不显示鼠标外观 for(int i=0;i<15000;i+=splashgif.speed()){ QCoreApplication::processEvents(); Sleep(splashgif.speed()/5); } // QCoreApplication::processEvents(); toolbox w; w.show(); splash.finish(&w);//程序启动画面结束 return a.exec(); ```