-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
44 lines (40 loc) · 1.17 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
#include "MainWindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QSplashScreen>
#include <QTimer>
#include "arkbrowser/browserapplication.h"
#include "arkbrowser/browsermainwindow.h"
#include <QDebug>
int main(int argc, char *argv[])
{
BrowserApplication a(argc, argv);
//MainWindow w;
BrowserMainWindow w;
QRect maxRect;
{
QDesktopWidget desktop;
maxRect = desktop.availableGeometry();
maxRect.adjust(50,50,-50,-50);
}
w.setGeometry(maxRect);
qDebug() << QApplication::applicationDirPath() << QApplication::applicationFilePath();
{
QPixmap splashPixmap(QApplication::applicationDirPath() + "/comm/conf/pics/splash.png");
QSplashScreen splash(splashPixmap);
splash.show();
enum{
splashTime = 1500
};
QTimer timer;
timer.start(splashTime);
do{
a.processEvents();
splash.showMessage(QString("Loading Process: %1%").arg(timer.remainingTime()*100.0/splashTime),Qt::AlignBottom);
}while(timer.remainingTime() > 1);
splash.finish(&w);
}
w.show();
a.processEvents();
return a.exec();
}