首页 > 其他 > 详细

qt-设置启动界面

时间:2020-02-11 18:54:36      阅读:97      评论:0      收藏:0      [点我收藏+]
#include "musicwidget.h"
#include <QApplication>
#include <QDateTime>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QPixmap pixmap(":/resources/default_album.jpg");    //启动界面图片
    QSplashScreen screen(pixmap);
    screen.show();
    screen.showMessage("LOVE", Qt::AlignCenter, Qt::red);   

    a.processEvents();                       //防止界面卡死
    screen.showMessage("LOVE");

    QDateTime n=QDateTime::currentDateTime();
    QDateTime now;
    do{
         now=QDateTime::currentDateTime();
    } while (n.secsTo(now)<=5);

    MusicWidget w;
    w.show();

    screen.finish(&w);

    return a.exec();

qt-设置启动界面

原文:https://www.cnblogs.com/shangangjun/p/12296047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!