]> git.sur5r.net Git - fstl/commitdiff
Derived App from QApplication
authorMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:26:27 +0000 (10:26 -0400)
committerMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:26:27 +0000 (10:26 -0400)
qt/fstl.pro
src/app.cpp [new file with mode: 0644]
src/app.h [new file with mode: 0644]
src/main.cpp

index 1dfdd24210bc6d4c47b04972c7fee374d9c7a377..191c542379c1650670791166eb792e16d29680c6 100644 (file)
@@ -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 (file)
index 0000000..c8dba62
--- /dev/null
@@ -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 (file)
index 0000000..2b440ed
--- /dev/null
+++ b/src/app.h
@@ -0,0 +1,23 @@
+#ifndef APP_H
+#define APP_H
+
+#include <QApplication>
+
+class Window;
+
+class App : public QApplication
+{
+    Q_OBJECT
+public:
+    explicit App(int argc, char *argv[]);
+
+signals:
+
+public slots:
+
+private:
+    Window* window;
+
+};
+
+#endif // APP_H
index 8653dd02dfab599b7bb06c1dca6aea2e1a62172a..4b76222110f3f3fa97c1793b78626e2f6db32537 100644 (file)
@@ -1,15 +1,9 @@
 #include <QApplication>
 
-#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();
 }