-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonStack.h
More file actions
71 lines (57 loc) · 1.93 KB
/
ButtonStack.h
File metadata and controls
71 lines (57 loc) · 1.93 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
67
68
69
70
71
#ifndef BUTTONSTACK_H
#define BUTTONSTACK_H
#include <QPushButton>
#include <QStackedLayout>
class ButtonStack : public QWidget{
QWidget* contextButtonsFlash;
QWidget* contextButtonsBack;
QStackedLayout* layout;
QPushButton* flashButton;
QPushButton* backButton;
public:
ButtonStack(): QWidget() {
layout = new QStackedLayout();
QWidget::setLayout(layout);
contextButtonsFlash = new QWidget();
contextButtonsFlash->setLayout(new QHBoxLayout());
flashButton = new QPushButton("Flash");
flashButton->setFixedHeight(60);
flashButton->setStyleSheet("font-size: 20px;");
contextButtonsFlash->layout()->addWidget(flashButton);
/*QPushButton* printButton = new QPushButton("Print");
printButton->setFixedHeight(60);
printButton->setStyleSheet("font-size: 20px;");
contextButtonsWic->layout()->addWidget(printButton);*/
contextButtonsBack = new QWidget();
contextButtonsBack->setLayout(new QHBoxLayout());
backButton = new QPushButton("Back");
backButton->setFixedHeight(60);
backButton->setStyleSheet("font-size: 20px;");
contextButtonsBack->layout()->addWidget(backButton);
backButton->setEnabled(false);
layout->addWidget(contextButtonsFlash);
layout->addWidget(contextButtonsBack);
}
QPushButton* getFlashButton(){
return flashButton;
}
QPushButton* getBackButton(){
return backButton;
}
void displayFlash(){
backButton->setEnabled(false);
layout->setCurrentWidget(contextButtonsFlash);
}
void displayBack(){
backButton->setEnabled(false);
layout->setCurrentWidget(contextButtonsBack);
}
~ButtonStack(){
delete contextButtonsFlash;
delete contextButtonsBack;
delete layout;
delete flashButton;
delete backButton;
}
};
#endif // BUTTONSTACK_H