forked from donaloconnor/automon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errorhandler.cpp
43 lines (35 loc) · 2.06 KB
/
errorhandler.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
/*
==================================================================================================
| errorhandler.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]> |
==================================================================================================
Implementation of the ErrorHandler class
*/
#include "errorhandler.h"
ErrorHandler::ErrorHandler(QWidget * parent)
: QMessageBox(parent)
{
/* Set no frame around window */
setWindowFlags(Qt::FramelessWindowHint);
setStyleSheet("background-color: rgba(51,51,51,80%); color:beige");
}
void ErrorHandler::errorSlot(QString message)
{
QString msg(tr(message.toLatin1()));
setText(msg);
/* Modal means that nothign in background can be clicked. This dialog has full attention */
setModal(true);
/* Launch the message */
exec();
exit(1); /* Somehow if it could kill itself and restart instead of just exiting */
}