diff --git a/MainApplication.cpp b/MainApplication.cpp new file mode 100644 index 0000000..3e97e79 --- /dev/null +++ b/MainApplication.cpp @@ -0,0 +1,46 @@ +/* + * MainApplication.cpp + * + * (c) 2014 Sofian Audry -- info(@)sofianaudry(.)com + * (c) 2014 Alexandre Quessy -- alexandre(@)quessy(.)net + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "MainApplication.h" + +MainApplication::MainApplication(int &argc, char *argv[]) + : QApplication(argc, argv) +{ + +} + +MainApplication::~MainApplication() +{ +} + +bool MainApplication::notify(QObject *receiver, QEvent *event) +{ + try + { + return QApplication::notify(receiver, event); + } + catch (std::exception &ex) + { + qDebug() << "std::exception was caught: " << ex.what() << endl; + qDebug() << "event type: " << event->type() << endl; + } + + return false; +} diff --git a/MainApplication.h b/MainApplication.h new file mode 100644 index 0000000..5464bc8 --- /dev/null +++ b/MainApplication.h @@ -0,0 +1,36 @@ +/* + * MainApplication.h + * + * (c) 2014 Sofian Audry -- info(@)sofianaudry(.)com + * (c) 2014 Alexandre Quessy -- alexandre(@)quessy(.)net + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef MAINAPPLICATION_H_ +#define MAINAPPLICATION_H_ + +#include +#include + +class MainApplication : public QApplication +{ +public: + MainApplication(int &argc, char *argv[]); + virtual ~MainApplication(); + + bool notify(QObject *receiver, QEvent *event); +}; + +#endif /* MAINAPPLICATION_H_ */ diff --git a/libremapping.pro b/libremapping.pro index 756c2c0..e6716f6 100644 --- a/libremapping.pro +++ b/libremapping.pro @@ -3,6 +3,7 @@ TEMPLATE = app HEADERS = \ DestinationGLCanvas.h \ # Facade.h \ + MainApplication.h \ MainWindow.h \ Mapper.h \ MapperGLCanvas.h \ @@ -22,6 +23,7 @@ SOURCES = \ DestinationGLCanvas.cpp \ # Facade.cpp \ MainWindow.cpp \ + MainApplication.cpp \ Mapper.cpp \ MapperGLCanvas.cpp \ Mapping.cpp \ diff --git a/main.cpp b/main.cpp index cf89877..526bdc5 100644 --- a/main.cpp +++ b/main.cpp @@ -1,18 +1,19 @@ // NOTE: To run, it is recommended not to be in Compiz or Beryl, they have shown some instability. #include -#include + #include #include #include "Common.h" #include "MainWindow.h" +#include "MainApplication.h" #include int main(int argc, char *argv[]) { // TODO: avoid segfaults when OSC port is busy - QApplication app(argc, argv); + MainApplication app(argc, argv); if (! QGLFormat::hasOpenGL()) {