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>463899356@QQ.COM</i></b></font>",Qt::AlignCenter,Qt::black);
QTimer *tim = new QTimer(splash);
tim->start(3000);
QObject::connect(tim,SIGNAL(timeout()),splash,SLOT(close()));
};