From ae2aaecfc1b2402a55e99cf674eff7b6175b0b6d Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 26 Apr 2025 14:57:56 -0400 Subject: Basic hex formatting on row headers for storage tables --- gui/storageview.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'gui/storageview.cc') 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 #include @@ -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> &data) this->d = data; endResetModel(); } + +void StorageView::set_hex_display(bool hex) +{ + if (this->is_hex != hex) { + beginResetModel(); + this->is_hex = hex; + endResetModel(); + } +} -- cgit v1.2.3