用Qt製作mdl程序啓動界面

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()));
};


發佈了32 篇原創文章 · 獲贊 0 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章