diff options
author | bd <bdunahu@operationnull.com> | 2025-04-21 15:56:38 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-21 15:56:38 -0400 |
commit | 40dfec9ae067d3f8e3868d259bfc4251aeca8724 (patch) | |
tree | 28316cbc00a8e89ead3225d80b9199381a996d86 /gui/gui.cc | |
parent | 89763e6f696a96ad310f031c66960bcaaba3ffdb (diff) |
Add functionality to toggle button.
Diffstat (limited to 'gui/gui.cc')
-rw-r--r-- | gui/gui.cc | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -48,6 +48,13 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) worker = new Worker(); worker->moveToThread(&workerThread); + // find all the labels + QList<DigitLabel*> labels = this->findChildren<DigitLabel*>(); + for (DigitLabel* label : labels) { + connect(this, &GUI::hex_toggled, label, &DigitLabel::on_hex_toggle); + } + emit this->hex_toggled(this->is_hex); + // display clock cycles and PC connect(worker, &Worker::clock_cycles, this, &GUI::on_worker_refresh_gui); @@ -207,6 +214,7 @@ void GUI::onWorkerExecuteInfo(const std::vector<int> info) void GUI::onWorkerMemoryInfo(const std::vector<int> info) { if (!info.empty()) { + std::cout << "this " << info[3] << std::endl; ui->memory_mnemonic->setText(mnemonicToString((Mnemonic)info[0])); ui->memory_squashed->setText(QString::number(info[1])); ui->memory_s1->set_value(info[2]); @@ -299,13 +307,13 @@ void GUI::on_upload_program_state_btn_clicked() void GUI::on_enable_pipeline_checkbox_checkStateChanged( const Qt::CheckState &arg1) { - if (arg1 == Qt::CheckState::Checked) { - qDebug() << "enable pipeline checkbox checked."; - this->is_pipelined = true; - } else { - qDebug() << "enable pipeline checkbox unchecked."; - this->is_pipelined = false; - } + this->is_pipelined = (arg1 == Qt::CheckState::Checked) ? true : false; +} + +void GUI::on_base_toggle_checkbox_checkStateChanged(const Qt::CheckState &state) +{ + this->is_hex = (state == Qt::CheckState::Checked) ? false : true; + emit this->hex_toggled(this->is_hex); } void GUI::on_step_btn_clicked() |