-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
62 lines (41 loc) · 1.83 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "common.h"
#include "scene.h"
//#include <QtGui/QApplication>
#include <QApplication>
#include <QMainWindow>
#include "qmlapplicationviewer.h"
#include "QT_UI/screenwidget.h"
#include "QT_UI/toolbarwidget.h"
#include <QHBoxLayout>
#include <QGridLayout>
#include <QtGui>
#include <QObject>
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow *window = new QMainWindow();
//Scene scene(25,15,10,10);
Scene scene;
ScreenWidget screenWidget;
screenWidget.setScene(&scene);
QWidget *centralWidget = new QWidget(window);
QGridLayout *gridlayout = new QGridLayout();
centralWidget->setLayout(gridlayout);
ToolBarWidget toolbarWidget;
toolbarWidget.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QObject::connect(toolbarWidget.getPlayButton(), SIGNAL(released()), &screenWidget, SLOT(playPressed()));
QObject::connect(toolbarWidget.getPauseButton(), SIGNAL(released()), &screenWidget, SLOT(pausePressed()));
QObject::connect(toolbarWidget.getStepButton(), SIGNAL(released()), &screenWidget, SLOT(stepPressed()));
QObject::connect(toolbarWidget.getStartButton(), SIGNAL(released()), &screenWidget, SLOT(startPressed()));
QObject::connect(toolbarWidget.getStopButton(), SIGNAL(released()), &screenWidget, SLOT(stopPressed()));
QObject::connect(toolbarWidget.getSaveButton(), SIGNAL(released()), &screenWidget, SLOT(savePressed()));
QObject::connect(toolbarWidget.getLoadButton(), SIGNAL(released()), &screenWidget, SLOT(loadPressed()));
gridlayout->addWidget(&toolbarWidget,0,1);
QScrollArea *const scroll(new QScrollArea);
scroll->setWidget(&screenWidget);
gridlayout->addWidget(scroll,1,1);
window->setCentralWidget(centralWidget);
window->show();
//sreenWidget.show();
return app.exec();
}