-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.cpp
More file actions
66 lines (45 loc) · 1.47 KB
/
gui.cpp
File metadata and controls
66 lines (45 loc) · 1.47 KB
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
#include "gui.h"
Gui::Gui(QPoint pos, QSize size,QWidget* parent) :QWidget(parent)
{
mainLayout = new QVBoxLayout();
menu = new QHBoxLayout();
statContainer = new QVBoxLayout();
statContainer2 = new QVBoxLayout();
reset = new QPushButton();
reset->setText("Reset");
oneStep = new QPushButton();
oneStep->setText("1 Step");
run = new QPushButton("Run");
menu->addWidget(reset);
menu->addWidget(oneStep);
menu->addWidget(run);
//Definition du widget stat
Step = new QLabel(QString("Step : 0"));
currentState = new QLabel(QString("currentState : 1"));
cursorPosition = new QLabel(QString("cursorPosition : (0;0)"));
statContainer->addWidget(Step);
statContainer->addWidget(currentState);
statContainer2->addWidget(cursorPosition);
//Ajout du tableau de stat au menu
menu->addLayout(statContainer);
menu->addLayout(statContainer2);
mainLayout->addLayout(menu);
setLayout(mainLayout);
// move(pos);
setMaximumSize(size);
}
void Gui::updateStep(int scr){
QString tmpS("Step : ");
tmpS += QString::number(scr);
Step->setText(tmpS);
}
void Gui::updateCurrentState(int scr){
QString tmpS("currentState : ");
tmpS += QString::number(scr);
currentState->setText(tmpS);
}
void Gui::updateCursorPos(int x, int y){
QString tmpS("Position : (");
tmpS += QString::number(x) + QString(" ; ") + QString::number(y)+QString(")");
cursorPosition->setText(tmpS);
}