ATLAS Offline Software
Loading...
Searching...
No Matches
VP1QtApplication.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Header file for class VP1QtApplication //
8// //
9// Author: Riccardo Maria BIANCHI <rbianchi@cern.ch> //
10// //
11// This class reimplements the basic notify() method //
12// of the QApplication class, in order to catch //
13// exceptions from C++, and to avoid fatal errors //
14// like: //
15// "Qt has caught an exception thrown from an event //
16// handler. Throwing exceptions from an event handler //
17// is not supported in Qt. You must reimplement //
18// QApplication::notify() and catch all exceptions //
19// there. //
20// //
21// //
22// Initial version: 19 November 2012 //
23// //
25
26#ifndef VP1QTAPPLICATION_H
27#define VP1QTAPPLICATION_H
28
29// include C++
30//#include <stddef.h> // this to fix the 'ptrdiff_t' does not name a type error with Qt (http://qt-project.org/forums/viewthread/16992)
31
32// include Qt
33#include <QApplication>
34#include <QMessageBox>
35
36
37
38
39/* reimplementaion of the main QApplication class,
40 * to reimplement the notify() function,
41 * in order to catch C++ exceptions
42 */
43class VP1QtApplication: public QApplication {
44 Q_OBJECT
45public:
46 VP1QtApplication(int &argc, char **argv): QApplication(argc, argv) {};
47 virtual ~VP1QtApplication() {};
48 virtual bool notify(QObject *rec, QEvent *ev);
49};
50
51#endif
52
53
VP1QtApplication(int &argc, char **argv)
virtual ~VP1QtApplication()
virtual bool notify(QObject *rec, QEvent *ev)
int ev
Definition globals.cxx:25