其他分享
首页 > 其他分享> > qt-设置启动界面

qt-设置启动界面

作者:互联网

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

标签:now,界面,qt,show,screen,include,设置,QDateTime
来源: https://www.cnblogs.com/shangangjun/p/12296047.html