#include <QApplication>
#include<QSplashScreen>
#include<QDateTime>
#include<QTextCodec>
#include<QDebug>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QApplication app(argc,argv);
QSplashScreen *splash=new QSplashScreen(QPixmap(":/images/splash.jpg"));
splash->show();
Qt::Alignment bottomLeft=Qt::AlignBottom|Qt::AlignLeft;
splash->showMessage("程序启动中...",bottomLeft,Qt::red);
MainWindow *window=new MainWindow();
QDateTime n=QDateTime::currentDateTime();
QDateTime now;
do
{
now=QDateTime::currentDateTime();
}while(n.secsTo(now)<=1);
splash->showMessage("资源加载中...",bottomLeft,Qt::red);
n=QDateTime::currentDateTime();
do
{
now=QDateTime::currentDateTime();
}while(n.secsTo(now)<=2);
window->show();
splash->finish(window);
delete splash;
return app.exec();
}