Qt 啟動畫面(Splash Screen)
Qt 啟動畫面(Splash Screen) #include <QtGui/QApplication> #include <QMainWindow> #include <QPixmap> #include <QBitmap> #include <QSplashScreen> int main(int argc, char *argv[]) { QApplication a(argc, argv); //啟動畫面 QSplashScreen *splash = new QSplashScreen; //顯示圖片 QPixmap px(":/res/logo.png"); splash->setPixmap(px); //遮罩圖 splash->setMask(px.mask()); splash->show(); QMainWindow w; w.show(); //如果w顯示出來的話,才關閉啟動畫面 splash->finish(&w); delete splash; return a.exec(); }