您的位置:首页 > 编程语言 > Qt开发

Qt 之程序启动画面

2015-08-27 17:38 330 查看
#include <QtWidgets/QApplication>

#include <QSplashScreen>

#include <QDateTime>

int main(int argc, char *argv[])

{

QApplication a(argc, argv);

QSplashScreen *splash=new QSplashScreen;

splash->setPixmap(QPixmap("start.png"));

//splash->setWindowFlags(Qt::FramelessWindowHint);

splash->show();

Qt::Alignment topRight =Qt::AlignRight |Qt::AlignTop;

splash->showMessage(QObject::tr("程序.正在启动中......."),

topRight,Qt::white);

Mota w;

QDateTime n2=QDateTime::currentDateTime();

QDateTime now;

do{

now=QDateTime::currentDateTime();

} while (n2.secsTo(now)<=3);//3为需要延时的秒数

w.show();

splash->finish(&w);

delete splash;

return a.exec();

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: