From: Matt Keeter Date: Fri, 14 Mar 2014 14:26:27 +0000 (-0400) Subject: Derived App from QApplication X-Git-Tag: v0.9.0~20 X-Git-Url: https://git.sur5r.net/?p=fstl;a=commitdiff_plain;h=a9ea3928e4283da55543bd58ec634c6df9c7df78 Derived App from QApplication --- diff --git a/qt/fstl.pro b/qt/fstl.pro index 1dfdd24..191c542 100644 --- a/qt/fstl.pro +++ b/qt/fstl.pro @@ -4,6 +4,7 @@ TARGET = fstl TEMPLATE = app SOURCES += \ + ../src/app.cpp\ ../src/main.cpp\ ../src/canvas.cpp \ ../src/mesh.cpp \ @@ -13,6 +14,7 @@ SOURCES += \ ../src/backdrop.cpp HEADERS += \ + ../src/app.h\ ../src/canvas.h \ ../src/mesh.h \ ../src/glmesh.h \ diff --git a/src/app.cpp b/src/app.cpp new file mode 100644 index 0000000..c8dba62 --- /dev/null +++ b/src/app.cpp @@ -0,0 +1,8 @@ +#include "app.h" +#include "window.h" + +App::App(int argc, char *argv[]) : + QApplication(argc, argv), window(new Window()) +{ + window->show(); +} diff --git a/src/app.h b/src/app.h new file mode 100644 index 0000000..2b440ed --- /dev/null +++ b/src/app.h @@ -0,0 +1,23 @@ +#ifndef APP_H +#define APP_H + +#include + +class Window; + +class App : public QApplication +{ + Q_OBJECT +public: + explicit App(int argc, char *argv[]); + +signals: + +public slots: + +private: + Window* window; + +}; + +#endif // APP_H diff --git a/src/main.cpp b/src/main.cpp index 8653dd0..4b76222 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,15 +1,9 @@ #include -#include "window.h" -#include "mesh.h" -#include "glmesh.h" +#include "app.h" int main(int argc, char *argv[]) { - QApplication a(argc, argv); - - Window window; - window.show(); - + App a(argc, argv); return a.exec(); }