Derived App from QApplication

This commit is contained in:
Matt Keeter 2014-03-14 10:26:27 -04:00
parent 1eaae882a0
commit a9ea3928e4
4 changed files with 35 additions and 8 deletions

View 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 \

8
src/app.cpp Normal file
View file

@ -0,0 +1,8 @@
#include "app.h"
#include "window.h"
App::App(int argc, char *argv[]) :
QApplication(argc, argv), window(new Window())
{
window->show();
}

23
src/app.h Normal file
View file

@ -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

View 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();
}