Qt的QSplashScreen是製作軟件的啓動時加載一張圖片,啓動完成,則消失。
mdl開發的插件也可以在啓動時候來個類似的動作。用mdl || Nativecod製作,不知要寫多少,用Qt簡單多了。將下面的函數到MdlMain裏,就ok了。
不需要QSplashScreen的finished函數了。
#include "stdafx.h"
#include <QtGui/QSplashScreen>
#include <QtGui/QWidget>
#include <Qt/qtimer.h>
void showSplish()
{
char path[MAX_PATH];
if(SUCCESS != mdlFile_find(path,"debug.png","MS_ICONPATH",0))
return;
QSplashScreen *splash = new QSplashScreen(0,QPixmap(path),Qt::Dialog);
splash->setAttribute(Qt::WA_DeleteOnClose);
splash->show();
splash->showMessage("<font size=60><b>MSFans<br><i>[email protected]</i></b></font>",Qt::AlignCenter,Qt::black);
QTimer *tim = new QTimer(splash);
tim->start(3000);
QObject::connect(tim,SIGNAL(timeout()),splash,SLOT(close()));
};