接上文
一个简单的基于QT的程序启动画面代码为:
#include <QtGui/QApplication>
#include <QtGui/QSplashScreen>
#include <QtGui/QPixmap>
#include "registerdlg.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSplashScreen* splash = new QSplashScreen(QPixmap("DevCPP.bmp"));
splash->show();
RegisterDlg w;
//! load some data
Qt::Alignment topright = Qt::AlignRight | Qt::AlignTop;
splash->showMessage(QObject::tr("Loading addins"),topright,Qt::blue);
//! load soma data
for(int i = 0;i< 9999;i++)
;
w.show();
splash->finish(&w);
delete splash;
return a.exec();
}