TerraViewApp.cpp
Go to the documentation of this file.
1 #include "TerraViewApp.h"
2 #include <exception>
3 #include <iostream>
4 
5 #include <QMessageBox>
6 
7 TerraViewApp::TerraViewApp(int& argc, char** argv) :
8  QApplication(argc, argv)
9 {
10 }
11 
12 bool TerraViewApp::notify(QObject* receiver, QEvent* event)
13 {
14  bool done = true;
15 
16  try
17  {
18  done = QApplication::notify(receiver, event);
19  }
20  catch (const std::exception& ex)
21  {
22  QMessageBox::warning(0, tr("TerraView"), QString(ex.what()));
23 
24  std::cout << std::endl << "Exception catched: " << ex.what() << std::endl;
25  }
26  catch (...)
27  {
28  QMessageBox::warning(0, tr("TerraView"), "Unknown Error.");
29 
30  std::cout << "Unknown exception catched\n";
31  }
32 
33  return done;
34 }
TerraViewApp(int &argc, char **argv)
Definition: TerraViewApp.cpp:7
bool notify(QObject *receiver_, QEvent *event_)