forked from donaloconnor/automon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
62 lines (51 loc) · 2.64 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
53
54
55
56
57
58
59
60
61
62
/*
==================================================================================================
| main.cpp |
| Part of the Automon application. |
| |
| Final Year Project - "An Embedded Automotive Monitoring Device" |
| |
| By Donal O' Connor for completion of B.Sc (Hons) Software Development and Computer Networking |
| Email: [email protected] |
| Website/Blog: http://automon.killarneyonline.eu |
| |
| Cork Institute of Technology, Cork, Ireland - http://www.cit.ie/ |
| |
| Copyright © 2009 Donal O'Connor <[email protected]> |
==================================================================================================
This is the entry point of the Automon Application. It sets up an Application instance and looks after
handling the splash screen.
*/
#include <QApplication>
#include <QFile>
#include <QWidget>
#include <QSplashScreen>
#include "automonapp.h"
int main(int argc, char *argv[])
{
/* Create an application */
QApplication a(argc, argv);
/* Set up styling of application */
QFile styleSheet(":/files/automon.qss");
/* Open file */
if (!styleSheet.open(QIODevice::ReadOnly)) {
qWarning("Unable to open :/files/automon.qss");
exit(0);
}
/* Apply stylesheet to application */
a.setStyleSheet(styleSheet.readAll());
/* Disable the cursor since using touch screen */
// a.setOverrideCursor( QCursor( Qt::BlankCursor )); [LA]
/* Open Splashscreen image, create a SplashScreen with it and show splash screen */
QPixmap pixmap(":/files/splashscreen.png");
QSplashScreen splash(pixmap);
splash.show();
/* Start our automon application */
AutomonApp automon(&splash);
// automon.setCursor(QCursor(Qt::BlankCursor)); [LA]
automon.show();
/* Finsih the splashscreen once Automon has loaded */
splash.finish(&automon);
/* Run event loop */
return a.exec();
}