-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.cpp
More file actions
66 lines (54 loc) · 1.72 KB
/
Copy pathmain.cpp
File metadata and controls
66 lines (54 loc) · 1.72 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "expertsdr_va2_1.h"
#include <QtGlobal>
#include <QApplication>
#include <QFont>
#include <QSplashScreen>
#include <QTranslator>
#include "Logger/VLogger.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//Set icon to application
QFile way(":MainIcon.ico");
if(!way.open(QIODevice::ReadOnly))
{
qDebug()<<"not able to open icon";
}
QIcon icon(":MainIcon.ico");
a.setWindowIcon(icon);
//I set font for qt5
//For qt4 can be set at ~/.config/Trolletch.conf and add nex three lines
//[Qt]
//style=Fusion or Windows or GTK+
//font="Times New Roman,9,-1,5,50,0,0,0,0,0"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QFile res(":images/font/Times_New_Roman.ttf");
if(!res.open(QIODevice::ReadOnly))
{
qDebug()<<"not able to open font";
}
QFont myfont;
myfont.setFamily("Times New Roman");
myfont.setPointSize(9);
a.setFont(myfont);
#endif
if(!QGLFormat::hasOpenGL() || !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2))
{
QMessageBox::information(0, "OpenGL 1.2 ERROR!", "This system does not support OpenGL 1.2!");
qCritical() << "qApp: system does not support OpenGL 1.2!";
return -1;
}
QTranslator translator(0);
if(translator.load( QString("ExpertSDR_ru"), "." ))
a.installTranslator(&translator);
else
qWarning() << "qApp: set translation file - file is not exist!";
QPixmap pixmap(":images/splash.png");
QSplashScreen splash(pixmap);
splash.show();
a.processEvents();
ExpertSDR_vA2_1 w;
w.show();
splash.finish(&w);
return a.exec();
}