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
|
TEMPLATE = app
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
../src/app.cpp\
|
||||||
../src/main.cpp\
|
../src/main.cpp\
|
||||||
../src/canvas.cpp \
|
../src/canvas.cpp \
|
||||||
../src/mesh.cpp \
|
../src/mesh.cpp \
|
||||||
|
@ -13,6 +14,7 @@ SOURCES += \
|
||||||
../src/backdrop.cpp
|
../src/backdrop.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
../src/app.h\
|
||||||
../src/canvas.h \
|
../src/canvas.h \
|
||||||
../src/mesh.h \
|
../src/mesh.h \
|
||||||
../src/glmesh.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 <QApplication>
|
||||||
|
|
||||||
#include "window.h"
|
#include "app.h"
|
||||||
#include "mesh.h"
|
|
||||||
#include "glmesh.h"
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
App a(argc, argv);
|
||||||
|
|
||||||
Window window;
|
|
||||||
window.show();
|
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue