-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (33 loc) · 990 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <QApplication>
#include <QDesktopWidget>
#include <QTime>
#include <QDebug>
#include <QThread>
#include "mainwindow.h"
#include "slotworker.h"
#include "signalworker.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//解决中文乱码
//设置窗口图标
a.setWindowIcon(QIcon(":/new/icon/images/app_icon.png"));
MainWindow main_window;
QTime time;
time.start();
QPixmap pixmap(":/new/icon/images/start_background.jpg");
QSplashScreen screen(pixmap);
screen.show();
screen.showMessage("loading....", Qt::AlignCenter, Qt::red);
int delayTime=1;
QElapsedTimer timer;
timer.start();
while(timer.elapsed() < (delayTime * 1000))
{
a.processEvents();
}
main_window.SetAllWindowsSizeAndShow();
screen.finish(&main_window);
qDebug()<<"all windows show up time is"<< time.elapsed()/1000<<"s";
return a.exec();
}