summaryrefslogtreecommitdiff
path: root/gui/gui.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-26 12:32:34 -0400
committerbd <bdunahu@operationnull.com>2025-04-26 12:32:34 -0400
commit94c0d7b5045244f20dfa13f7d31e0e06901908c2 (patch)
tree2e7d8faf981fb84dcd2c1fbe2daad0e3e013dd0c /gui/gui.cc
parenta78163745b43a0c420ae4ea5792def30a94420eb (diff)
Add a digit delegate to toggle table base display
Diffstat (limited to 'gui/gui.cc')
-rw-r--r--gui/gui.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index ecdf9d3..80d4a2a 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -17,6 +17,7 @@
#include "gui.h"
#include "./ui_gui.h"
+#include "digitlabeldelegate.h"
#include "dynamicwaysentry.h"
#include "messages.h"
#include "storageview.h"
@@ -57,7 +58,6 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI)
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);
@@ -345,6 +345,7 @@ void GUI::make_tabs(int num)
StorageView *e;
QTableView *t;
QString n;
+ DigitLabelDelegate *d;
ui->storage->clear();
@@ -361,11 +362,18 @@ void GUI::make_tabs(int num)
e = new StorageView(MEM_LINES, this);
} else {
n = QString("L%1").arg(i - 1);
- e = new StorageView(cache_size_mapper(this->curr_cache_levels, i), this);
+ e = new StorageView(
+ cache_size_mapper(this->curr_cache_levels, i), this);
}
t = new QTableView;
t->setModel(e);
+ d = new DigitLabelDelegate(t);
+
+ connect(
+ this, &GUI::hex_toggled, d, &DigitLabelDelegate::set_hex_display);
+
+ t->setItemDelegate(d);
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->storage->addTab(t, n);