-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
52 lines (46 loc) · 1.45 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
52
#include <QtWidgets/QApplication>
#include <QSplashScreen>
#include <QDebug>
#include <QPainter>
#include "VirtualTouchScreen.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
QPixmap splashImg(":/icons/splash.jpg");
if (!splashImg.isNull())
{
QPainter painter(&splashImg);
painter.setPen(Qt::darkBlue);
QFont font("Arial", 30);
painter.setFont(font);
QSize size = splashImg.size();
int posX = size.width()/6;
int posY = size.height()/2;
painter.drawText(posX, posY, "Virtual Touch Screen");
painter.setPen(Qt::blue);
painter.setFont(QFont("Arial", 15));
posY -= 30;
painter.drawText(posX, posY+100, "Available commands:");
painter.drawText(posX, posY+130, " - F1: help");
painter.drawText(posX, posY+160, " - F2: shows the configuration dialog");
painter.drawText(posX, posY+190, " - ctrl+q: quits the application");
painter.setFont(QFont("Arial", 12, -1, true));
posX = size.width()/3;
posY = 300;
painter.drawText(posX, posY+150, "Copyright Bogdan Cristea");
painter.drawText(posX-10, posY+170, "e-mail: [email protected]");
}
else
{
qDebug() << "Cannot load splash screen";
}
QSplashScreen splashScr(splashImg);
splashScr.show();
splashScr.showMessage("Initializing gesture camera ...");
a.processEvents();
VirtualTouchScreen w;
w.show();
splashScr.finish(&w);
return a.exec();
}