-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
51 lines (43 loc) · 1.38 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
#ifdef WIN32
#pragma execution_character_set("utf-8")
#endif
#include <QApplication>
#include <QTextCodec>
#include <QFile>
#include <QSplashScreen>
#include <QDesktopWidget>
#include <QThread>
#include "qglobal.h"
#include "simplecontrolwindow.h"
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
app.setApplicationVersion("1.0");
app.setApplicationName("Easy System");
QPixmap pixmap(":/images/sp.png");
QSplashScreen splash(pixmap);
splash.show();
splash.showMessage("Loaded Files", Qt::AlignRight | Qt::AlignTop, Qt::red);
qApp->processEvents();
QThread::msleep(3000);
//load qss file
QFile file( ":/style/style/style.qss");
file.open(QFile::ReadOnly);
QString qss = QLatin1String(file.readAll());
qApp->setStyleSheet(qss);
qApp->setWindowIcon(QIcon(":/logo.ico"));
splash.showMessage("connecting......", Qt::AlignRight | Qt::AlignTop, Qt::red);
QThread::msleep(400);
// SimpleControlWindow w;
// w.show();
// w.move((QApplication::desktop()->width() - w.width())/2, (QApplication::desktop()->height() - w.height())/2);
MainWindow w;
w.show();
QVariant d;//global property
d.setValue(&w);
app.setProperty("MainWindow",d);
splash.finish(&w);//splash is finish
return app.exec();
}