qt写一个应用启动界面,主窗口能显示,图片不显示,图片在工程的images文件夹下
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QTime>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap("logo.png"));
splash->show();
splash->showMessage(QObject::tr("XXXXXXX"),Qt::AlignCenter,Qt::blue);
a.processEvents();
MainWindow w;
QDateTime n2 = QDateTime::currentDateTime();
QDateTime now;
do{
now = QDateTime::currentDateTime();
}while (n2.secsTo(now)<=3);
w.show();
splash->finish(&w);
delete splash;
return a.exec();
}