From 511437312ccf917dcc816618e2a0595aecc32e59 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 11 Jan 2025 19:47:21 -0800 Subject: [PATCH] Qt: Revamp memory view layout --- src/platform/qt/MemoryView.cpp | 20 +- src/platform/qt/MemoryView.ui | 471 +++++++++++++++------------------ 2 files changed, 221 insertions(+), 270 deletions(-) diff --git a/src/platform/qt/MemoryView.cpp b/src/platform/qt/MemoryView.cpp index 4383867e0..cdb754bfe 100644 --- a/src/platform/qt/MemoryView.cpp +++ b/src/platform/qt/MemoryView.cpp @@ -133,20 +133,10 @@ MemoryView::MemoryView(std::shared_ptr controller, QWidget* pare } } - connect(m_ui.width8, &QAbstractButton::clicked, [this]() { - m_ui.hexfield->setAlignment(1); - m_sintValidator.setWidth(1); - m_uintValidator.setWidth(1); - }); - connect(m_ui.width16, &QAbstractButton::clicked, [this]() { - m_ui.hexfield->setAlignment(2); - m_sintValidator.setWidth(2); - m_uintValidator.setWidth(2); - }); - connect(m_ui.width32, &QAbstractButton::clicked, [this]() { - m_ui.hexfield->setAlignment(4); - m_sintValidator.setWidth(4); - m_uintValidator.setWidth(4); + connect(m_ui.width, &QComboBox::currentIndexChanged, [this](int index) { + m_ui.hexfield->setAlignment(1 << index); + m_sintValidator.setWidth(1 << index); + m_uintValidator.setWidth(1 << index); }); connect(m_ui.setAddress, static_cast(&QSpinBox::valueChanged), this, static_cast(&MemoryView::jumpToAddress)); @@ -258,7 +248,7 @@ void MemoryView::updateStatus() { mCore* core = m_controller->thread()->core; QByteArray selection(m_ui.hexfield->serialize()); QString text(m_ui.hexfield->decodeText(selection)); - m_ui.stringVal->setText(text); + m_ui.stringVal->setPlainText(text); if (m_selection.first & (align - 1) || m_selection.second - m_selection.first != align) { m_ui.sintVal->clear(); diff --git a/src/platform/qt/MemoryView.ui b/src/platform/qt/MemoryView.ui index 45879db88..06ab570d1 100644 --- a/src/platform/qt/MemoryView.ui +++ b/src/platform/qt/MemoryView.ui @@ -6,167 +6,14 @@ 0 0 - 874 - 900 + 708 + 549 Memory - - - - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - Inspect Address: - - - - - - - -1 - - - 0 - - - 16 - - - - - - - : - - - - - - - true - - - 0x - - - 268435455 - - - 16 - - - 16 - - - - - - - - - - - Set Alignment: - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - &1 Byte - - - true - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - &2 Bytes - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - &4 Bytes - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - + @@ -175,72 +22,255 @@ 0 + + + 200 + 0 + + - - - + + + + + + - + - Unsigned Integer: + Address: - - - 10 + + + Qt::Horizontal - + + + 0 + 0 + + + + + + + + -1 + + + 0 + + + 16 + + + + + + + : + + + + + + + + 100 + 0 + + + true + + 0x + + + 268435455 + + + 16 + + + 16 + - + - + - Signed Integer: + Alignment: - - - 11 - - - true + + + + 0 + 0 + + + + 1 Byte + + + + + 2 Bytes + + + + + 4 Bytes + + - - - - + + + + + 0 + 0 + + + + + + + + + + Signed: + + + + + + + 11 + + + true + + + + + + + + + + Unsigned: + + + + + + + 10 + + + true + + + + + + + + + + String: + + + + + + + + 0 + 0 + + + + Load TBL + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + - String: + Copy Selection - - - - true + + + + Save Selection - - + + - Load TBL + Paste + + + + + + + Save Range + + + + + + + + 0 + 0 + + + + Load @@ -248,58 +278,6 @@ - - - - - - Copy Selection - - - - - - - Paste - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Save Selection - - - - - - - Save Range - - - - - - - Load - - - - - @@ -310,23 +288,6 @@ 1 - - regions - segments - setAddress - width8 - width16 - width32 - sintVal - uintVal - stringVal - loadTBL - copy - paste - save - saveRange - load -