diff options
author | bd <bdunahu@operationnull.com> | 2025-04-26 14:57:56 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-26 14:57:56 -0400 |
commit | ae2aaecfc1b2402a55e99cf674eff7b6175b0b6d (patch) | |
tree | 651c14de4eb0467d898810bdb1e136f2e5089ded /gui/storageview.cc | |
parent | b32bc409c18ceb4cd8147f11021e2c4b2746184b (diff) |
Basic hex formatting on row headers for storage tables
Diffstat (limited to 'gui/storageview.cc')
-rw-r--r-- | gui/storageview.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gui/storageview.cc b/gui/storageview.cc index 43837a9..22baca0 100644 --- a/gui/storageview.cc +++ b/gui/storageview.cc @@ -17,6 +17,7 @@ #include "storageview.h" #include "definitions.h" +#include "digitlabelhelper.h" #include <QAbstractTableModel> #include <QVector> @@ -59,12 +60,13 @@ QVariant StorageView::headerData(int section, Qt::Orientation o, int role) const return QVariant(); if (o == Qt::Vertical) { - return section * 4; + return DigitLabelHelper::format_value(section * 4, this->is_hex); } return QVariant(); } -Qt::ItemFlags StorageView::flags(const QModelIndex &i) const { +Qt::ItemFlags StorageView::flags(const QModelIndex &i) const +{ (void)i; return Qt::ItemIsEnabled; } @@ -75,3 +77,12 @@ void StorageView::set_data(const QVector<QVector<int>> &data) this->d = data; endResetModel(); } + +void StorageView::set_hex_display(bool hex) +{ + if (this->is_hex != hex) { + beginResetModel(); + this->is_hex = hex; + endResetModel(); + } +} |