-
Notifications
You must be signed in to change notification settings - Fork 2
/
centralwidget.cpp
23 lines (20 loc) · 1.01 KB
/
centralwidget.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "centralwidget.h"
#include "ui_centralwidget.h"
CentralWidget::CentralWidget(QWidget* parent, QWidget* assembler, QWidget* memory, QWidget* disassembler)
: QWidget(parent), ui(new Ui::CentralWidget), assemblerWidget(assembler), memoryWidget(memory),
disassemblerWidget(disassembler) {
ui->setupUi(this);
ui->stackedWidget->addWidget(assemblerWidget);
ui->stackedWidget->addWidget(memoryWidget);
ui->stackedWidget->addWidget(disassemblerWidget);
connect(ui->assemblerViewButton, &QToolButton::clicked, [&] { ui->stackedWidget->setCurrentWidget(assemblerWidget); });
connect(ui->memoryViewButton, &QToolButton::clicked, [&] { ui->stackedWidget->setCurrentWidget(memoryWidget); });
connect(ui->disassemblerViewButton, &QToolButton::clicked, [&] { ui->stackedWidget->setCurrentWidget(disassemblerWidget); });
ui->assemblerViewButton->click();
}
bool CentralWidget::isVisible(const QWidget* w) const {
return ui->stackedWidget->currentWidget() == w;
}
CentralWidget::~CentralWidget() {
delete ui;
}