-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
49 lines (38 loc) · 1.13 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
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QTimer>
#include <QSound>
#include <QDebug>
#include <QFile>
#include <QTextStream>
QString readTesxtFile(QString path){
QFile file(path);
if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream in(&file);
return in.readAll();
}
return "";
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setWindowIcon(QIcon(":/new/logo/resource/logo/playstore-512.png"));
QString css = readTesxtFile(":/new/styleSheet/resource/styleSheet/css.css");
if(css.length() > 0){
a.setStyleSheet(css);
}
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap(":/new/images/resource/images/images.png"));
splash->show();
MainWindow w;
//w.show();
try {
QTimer::singleShot(2000,splash,SLOT(close()));
QSound::play(":/new/sounds/resource/sounds/244356__soneproject__digital-life-1.wav");
QTimer::singleShot(2000,&w,SLOT(show()));
} catch (...) {
qDebug() << "Handling exception not caught in slot.";
}
return a.exec();
}