Qt开机动画模板

直接上代码:

        MainWidget w;    //主界面
        //logo
        QSplashScreen *splash = new QSplashScreen;
        splash->setPixmap(QPixmap(":/ad/loading"));
        splash->show();
        QDateTime n2=QDateTime::currentDateTime();
        QDateTime now;
        Qt::Alignment topRight = Qt::AlignHCenter | Qt::AlignBottom;
        splash->showMessage(QObject::tr("Starting the main interface..."),topRight,         Qt::black);
        do{
            now=QDateTime::currentDateTime();
        }while (n2.secsTo(now)<=2);//2s
        splash->showMessage(QObject::tr("Loading database module..."),topRight, Qt::black);
        do{
            now=QDateTime::currentDateTime();
        }while (n2.secsTo(now)<=3);//3Ϊ��Ҫ��ʱ������
        do{
            now=QDateTime::currentDateTime();
        }while (n2.secsTo(now)<=4);//4Ϊ��Ҫ��ʱ������
        splash->finish(&w);
        w.show();

 

发布了25 篇原创文章 · 获赞 6 · 访问量 1万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 鲸 设计师: meimeiellie

分享到微信朋友圈

×

扫一扫,手机浏览