Derived App from QApplication
This commit is contained in:
parent
1eaae882a0
commit
a9ea3928e4
4 changed files with 35 additions and 8 deletions
|
@ -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
8
src/app.cpp
Normal 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
23
src/app.h
Normal 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
|
10
src/main.cpp
10
src/main.cpp
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue