-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrollerwindow.cpp
89 lines (71 loc) · 2.7 KB
/
controllerwindow.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "controllerwindow.h"
ControllerWindow::ControllerWindow(QWidget *parent) : QWidget(parent)
{
mainLayout = createDefaultLayout();
helloGLLayoutHolder = 0;
helloGLWindow = 0;
}
ControllerWindow::~ControllerWindow()
{
}
QVBoxLayout *ControllerWindow::createDefaultLayout()
{
quitButton = new QPushButton(tr("&Close"));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *bottomLayout = new QHBoxLayout();
bottomLayout->addStretch();
bottomLayout->addWidget(quitButton);
simpleWizardButton = new QPushButton(tr("&show Simple Wizard"));
connect(simpleWizardButton, SIGNAL(clicked()), this, SLOT(on_simpleWizardButton_clicked()));
helloGLButton = new QPushButton(tr("&show hello OpenGL example"));
connect(helloGLButton, SIGNAL(clicked()), this, SLOT(on_helloGLButton_clicked()));
QVBoxLayout *retLayout = new QVBoxLayout();
retLayout->addWidget(simpleWizardButton);
retLayout->addWidget(helloGLButton);
retLayout->addLayout(bottomLayout);
setLayout(retLayout);
return retLayout;
}
void ControllerWindow::on_simpleWizardButton_clicked()
{
SimpleWizard *testWizard = new SimpleWizard(this);
testWizard->buildWizardPages();
testWizard->show();
}
void ControllerWindow::on_helloGLButton_clicked()
{
helloGLWindow = new HelloGLWindow(this);
helloGLWindow->show();
QVBoxLayout *helloGLLayout = new QVBoxLayout();
QPushButton *lineButton = new QPushButton(tr("&draw line"));
QPushButton *rectButton = new QPushButton(tr("&draw rect"));
QPushButton *clearButton = new QPushButton(tr("&clear all items"));
QPushButton *closeHelloGLButton = new QPushButton(tr("&close example Window"));
connect(lineButton, SIGNAL(clicked()), this, SLOT(on_lineButton_clicked()));
connect(rectButton, SIGNAL(clicked()), this, SLOT(on_rectButton_clicked()));
connect(clearButton, SIGNAL(clicked()), this, SLOT(on_clearButton_clicked()));
connect(closeHelloGLButton, SIGNAL(clicked()), this, SLOT(on_closeHelloGLButton_clicked()));
helloGLLayout->addWidget(lineButton);
helloGLLayout->addWidget(rectButton);
helloGLLayout->addWidget(clearButton);
helloGLLayout->addWidget(closeHelloGLButton);
helloGLLayoutHolder = new QWidget();
helloGLLayoutHolder->setLayout(helloGLLayout);
helloGLButton->hide();
mainLayout->insertWidget(mainLayout->indexOf(helloGLButton), helloGLLayoutHolder);
}
void ControllerWindow::on_lineButton_clicked()
{
}
void ControllerWindow::on_rectButton_clicked()
{
}
void ControllerWindow::on_clearButton_clicked()
{
}
void ControllerWindow::on_closeHelloGLButton_clicked()
{
delete helloGLLayoutHolder;
helloGLButton->show();
helloGLWindow->close();
}