Privacy
An open-source, flexible 3D physical simulation framework
MyApp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012, DFKI GmbH Robotics Innovation Center
3  *
4  * This file is part of the MARS simulation framework.
5  *
6  * MARS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3
9  * of the License, or (at your option) any later version.
10  *
11  * MARS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with MARS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
27 #ifndef MY_APP_VIZ_H
28 #define MY_APP_VIZ_H
29 
30 #include <QApplication>
31 
32 #include <iostream>
33 
34 namespace mars {
35 
36  namespace viz {
37 
43  class MyApp : public QApplication {
44  public:
45  MyApp(int &argc, char **argv) : QApplication(argc, argv) {}
46  virtual bool notify( QObject *receiver, QEvent *event ) {
47  try {
48  return QApplication::notify(receiver, event);
49  } catch (const std::exception &e) {
50  std::cerr << e.what() << std::endl;
51  throw(e);
52  }
53  }
54  };
55 
56  } // end of namespace viz
57 } // end of namespace mars
58 
59 #endif // end of namespace MY_VIZ_APP_H
virtual bool notify(QObject *receiver, QEvent *event)
Definition: MyApp.h:46
Copyright 2012, DFKI GmbH Robotics Innovation Center.
This function provides a clean exit of the simulation in case of a kill-signal.
Definition: MyApp.h:43
MyApp(int &argc, char **argv)
Definition: MyApp.h:45