From 241d94da54aa5dd09a7441a38f82e997e8d37a24 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 10 Sep 2022 22:50:52 +0100 Subject: [PATCH] Off-loaded ByteItemGraphicsScene construction to Insight worker task --- src/Insight/CMakeLists.txt | 1 + src/Insight/Insight.cpp | 2 +- .../Tasks/ConstructHexViewerByteItemScene.cpp | 32 +++++++++ .../Tasks/ConstructHexViewerByteItemScene.hpp | 44 ++++++++++++ .../Stylesheets/InsightWindow.qss | 5 ++ .../ByteItemContainerGraphicsView.cpp | 54 ++++++++++---- .../ByteItemContainerGraphicsView.hpp | 10 ++- .../HexViewerWidget/ByteItemGraphicsScene.cpp | 8 +-- .../HexViewerWidget/ByteItemGraphicsScene.hpp | 9 ++- .../HexViewerWidget/HexViewerWidget.cpp | 72 ++++++++++++++----- .../HexViewerWidget/HexViewerWidget.hpp | 5 ++ .../UiFiles/HexViewerWidget.ui | 19 +++++ .../TargetMemoryInspectionPane.cpp | 13 ++++ 13 files changed, 231 insertions(+), 43 deletions(-) create mode 100644 src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.cpp create mode 100644 src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.hpp diff --git a/src/Insight/CMakeLists.txt b/src/Insight/CMakeLists.txt index bb812749..d103702c 100755 --- a/src/Insight/CMakeLists.txt +++ b/src/Insight/CMakeLists.txt @@ -31,6 +31,7 @@ target_sources( ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/ReadProgramCounter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/GetTargetState.cpp ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/GetTargetDescriptor.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/ConstructHexViewerByteItemScene.cpp # Error dialogue window ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index ac213551..e961ed5d 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -166,7 +166,7 @@ namespace Bloom */ auto* eventDispatchTimer = new QTimer(&(this->application)); QObject::connect(eventDispatchTimer, &QTimer::timeout, this, &Insight::dispatchEvents); - eventDispatchTimer->start(50); + eventDispatchTimer->start(100); QObject::connect( this->mainWindow, diff --git a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.cpp b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.cpp new file mode 100644 index 00000000..773ebdc5 --- /dev/null +++ b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.cpp @@ -0,0 +1,32 @@ +#include "ConstructHexViewerByteItemScene.hpp" + +namespace Bloom +{ + ConstructHexViewerByteItemScene::ConstructHexViewerByteItemScene( + const Targets::TargetMemoryDescriptor& memoryDescriptor, + std::vector& focusedMemoryRegions, + std::vector& excludedMemoryRegions, + const Widgets::HexViewerWidgetSettings& settings, + Widgets::Label* hoveredAddressLabel + ) + : memoryDescriptor(memoryDescriptor) + , focusedMemoryRegions(focusedMemoryRegions) + , excludedMemoryRegions(excludedMemoryRegions) + , settings(settings) + , hoveredAddressLabel(hoveredAddressLabel) + {} + + void ConstructHexViewerByteItemScene::run(TargetController::TargetControllerConsole&) { + auto* scene = new Widgets::ByteItemGraphicsScene( + this->memoryDescriptor, + this->focusedMemoryRegions, + this->excludedMemoryRegions, + this->settings, + this->hoveredAddressLabel, + nullptr + ); + + scene->moveToThread(nullptr); + emit this->sceneCreated(scene); + } +} diff --git a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.hpp b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.hpp new file mode 100644 index 00000000..f018514a --- /dev/null +++ b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.hpp @@ -0,0 +1,44 @@ +#pragma once + +#include "InsightWorkerTask.hpp" +#include "src/Targets/TargetMemory.hpp" + +#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp" +#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/FocusedMemoryRegion.hpp" +#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/ExcludedMemoryRegion.hpp" +#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp" +#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp" + +namespace Bloom +{ + class ConstructHexViewerByteItemScene: public InsightWorkerTask + { + Q_OBJECT + + public: + ConstructHexViewerByteItemScene( + const Targets::TargetMemoryDescriptor& memoryDescriptor, + std::vector& focusedMemoryRegions, + std::vector& excludedMemoryRegions, + const Widgets::HexViewerWidgetSettings& settings, + Widgets::Label* hoveredAddressLabel + ); + + TaskGroups getTaskGroups() const override { + return TaskGroups(); + }; + + signals: + void sceneCreated(Widgets::ByteItemGraphicsScene* scene); + + protected: + void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + + private: + const Targets::TargetMemoryDescriptor& memoryDescriptor; + std::vector& focusedMemoryRegions; + std::vector& excludedMemoryRegions; + const Widgets::HexViewerWidgetSettings& settings; + Widgets::Label* hoveredAddressLabel; + }; +} diff --git a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss index 23d95beb..f2968127 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss +++ b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss @@ -444,6 +444,11 @@ QScrollBar::sub-line:vertical { color: rgba(175, 177, 179, 0.3); } +#hex-viewer-container #loading-hex-viewer-label { + color: #838386; + font-size: 14px; +} + #hex-viewer-container QScrollBar:vertical { background-color: transparent; width: 12px; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.cpp index 2ca7434d..d872ded6 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.cpp @@ -1,17 +1,13 @@ #include "ByteItemContainerGraphicsView.hpp" +#include "src/Insight/InsightWorker/InsightWorker.hpp" +#include "src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItemScene.hpp" + namespace Bloom::Widgets { using Bloom::Targets::TargetMemoryDescriptor; - ByteItemContainerGraphicsView::ByteItemContainerGraphicsView( - const TargetMemoryDescriptor& targetMemoryDescriptor, - std::vector& focusedMemoryRegions, - std::vector& excludedMemoryRegions, - const HexViewerWidgetSettings& settings, - Label* hoveredAddressLabel, - QWidget* parent - ) + ByteItemContainerGraphicsView::ByteItemContainerGraphicsView(QWidget* parent) : QGraphicsView(parent) { this->setObjectName("graphics-view"); @@ -20,27 +16,52 @@ namespace Bloom::Widgets this->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff); this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); this->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); + } - this->scene = new ByteItemGraphicsScene( + void ByteItemContainerGraphicsView::initScene( + const TargetMemoryDescriptor& targetMemoryDescriptor, + std::vector& focusedMemoryRegions, + std::vector& excludedMemoryRegions, + const HexViewerWidgetSettings& settings, + Label* hoveredAddressLabel + ) { + auto* constructSceneTask = new ConstructHexViewerByteItemScene( targetMemoryDescriptor, focusedMemoryRegions, excludedMemoryRegions, settings, - hoveredAddressLabel, - this + hoveredAddressLabel ); - this->setScene(this->scene); + QObject::connect( + constructSceneTask, + &ConstructHexViewerByteItemScene::sceneCreated, + this, + [this] (ByteItemGraphicsScene* scene) { + scene->moveToThread(this->thread()); + scene->setParent(this); + this->scene = scene; + this->scene->refreshRegions(); + this->scene->setEnabled(this->isEnabled()); + this->setScene(this->scene); + + emit this->ready(); + } + ); + + InsightWorker::queueTask(constructSceneTask); } void ByteItemContainerGraphicsView::scrollToByteItemAtAddress(Targets::TargetMemoryAddress address) { - this->centerOn(this->scene->getByteItemPositionByAddress(address)); + if (this->scene != nullptr) { + this->centerOn(this->scene->getByteItemPositionByAddress(address)); + } } bool ByteItemContainerGraphicsView::event(QEvent* event) { const auto eventType = event->type(); - if (eventType == QEvent::Type::EnabledChange) { + if (eventType == QEvent::Type::EnabledChange && this->scene != nullptr) { this->scene->setEnabled(this->isEnabled()); } @@ -49,6 +70,9 @@ namespace Bloom::Widgets void ByteItemContainerGraphicsView::resizeEvent(QResizeEvent* event) { QGraphicsView::resizeEvent(event); - this->scene->adjustSize(); + + if (this->scene != nullptr) { + this->scene->adjustSize(); + } } } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.hpp index 2f85f233..027c5918 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemContainerGraphicsView.hpp @@ -18,13 +18,14 @@ namespace Bloom::Widgets Q_OBJECT public: - ByteItemContainerGraphicsView( + ByteItemContainerGraphicsView(QWidget* parent); + + void initScene( const Targets::TargetMemoryDescriptor& targetMemoryDescriptor, std::vector& focusedMemoryRegions, std::vector& excludedMemoryRegions, const HexViewerWidgetSettings& settings, - Label* hoveredAddressLabel, - QWidget* parent + Label* hoveredAddressLabel ); [[nodiscard]] ByteItemGraphicsScene* getScene() const { @@ -33,6 +34,9 @@ namespace Bloom::Widgets void scrollToByteItemAtAddress(Targets::TargetMemoryAddress address); + signals: + void ready(); + protected: bool event(QEvent* event) override; void resizeEvent(QResizeEvent* event) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp index da631251..dfe751d1 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp @@ -22,7 +22,6 @@ namespace Bloom::Widgets , excludedMemoryRegions(excludedMemoryRegions) , settings(settings) , hoveredAddressLabel(hoveredAddressLabel) - , parent(parent) { this->setObjectName("byte-widget-container"); @@ -60,8 +59,6 @@ namespace Bloom::Widgets &ByteItemGraphicsScene::onTargetStateChanged ); - this->refreshRegions(); - this->adjustSize(); } void ByteItemGraphicsScene::updateValues(const Targets::TargetMemoryBuffer& buffer) { @@ -153,6 +150,7 @@ namespace Bloom::Widgets } void ByteItemGraphicsScene::adjustSize(bool forced) { + const auto* parent = this->getParent(); const auto width = this->getSceneWidth(); const auto columnCount = static_cast( @@ -177,7 +175,7 @@ namespace Bloom::Widgets 0, 0, width, - std::max(static_cast(this->sceneRect().height()), this->parent->viewport()->height()) + std::max(static_cast(this->sceneRect().height()), parent->viewport()->height()) ); return; @@ -199,7 +197,7 @@ namespace Bloom::Widgets 0, 0, width, - std::max(sceneHeight, this->parent->height()) + std::max(sceneHeight, parent->height()) ); } } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp index f2dbb5f8..86c12b4b 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp @@ -93,7 +93,6 @@ namespace Bloom::Widgets const QMargins margins = QMargins(10, 10, 10, 10); const HexViewerWidgetSettings& settings; - QGraphicsView* parent = nullptr; Label* hoveredAddressLabel = nullptr; ByteAddressContainer* byteAddressContainer = nullptr; @@ -104,6 +103,11 @@ namespace Bloom::Widgets QGraphicsRectItem* rubberBandRectItem = nullptr; std::optional rubberBandInitPoint = std::nullopt; + + QGraphicsView* getParent() const { + return dynamic_cast(this->parent()); + } + int getSceneWidth() { /* * Minus 2 for the QSS margin on the vertical scrollbar (which isn't accounted for during viewport @@ -111,7 +115,8 @@ namespace Bloom::Widgets * * See https://bugreports.qt.io/browse/QTBUG-99189 for more on this. */ - return std::max(this->parent->viewport()->width(), 400) - 2; + auto* parent = this->getParent(); + return std::max(parent != nullptr ? parent->viewport()->width() : 400, 400) - 2; } void updateAnnotationValues(const Targets::TargetMemoryBuffer& buffer); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index 014353ae..e2df67ff 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -71,16 +71,8 @@ namespace Bloom::Widgets this->hoveredAddressLabel = this->bottomBar->findChild("byte-address-label"); + this->loadingHexViewerLabel = this->container->findChild("loading-hex-viewer-label"); this->byteItemGraphicsViewContainer = this->container->findChild("graphics-view-container"); - this->byteItemGraphicsView = new ByteItemContainerGraphicsView( - this->targetMemoryDescriptor, - this->focusedMemoryRegions, - this->excludedMemoryRegions, - this->settings, - this->hoveredAddressLabel, - this->byteItemGraphicsViewContainer - ); - this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene(); this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol); this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory); @@ -165,16 +157,48 @@ namespace Bloom::Widgets this->show(); } + void HexViewerWidget::init() { + this->byteItemGraphicsView = new ByteItemContainerGraphicsView(this->byteItemGraphicsViewContainer); + + QObject::connect( + this->byteItemGraphicsView, + &ByteItemContainerGraphicsView::ready, + this, + [this] { + this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene(); + this->loadingHexViewerLabel->hide(); + this->byteItemGraphicsViewContainer->show(); + this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size()); + + emit this->ready(); + } + ); + + this->byteItemGraphicsView->initScene( + this->targetMemoryDescriptor, + this->focusedMemoryRegions, + this->excludedMemoryRegions, + this->settings, + this->hoveredAddressLabel + ); + } + void HexViewerWidget::updateValues(const Targets::TargetMemoryBuffer& buffer) { - this->byteItemGraphicsScene->updateValues(buffer); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->updateValues(buffer); + } } void HexViewerWidget::refreshRegions() { - this->byteItemGraphicsScene->refreshRegions(); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->refreshRegions(); + } } void HexViewerWidget::setStackPointer(Targets::TargetStackPointer stackPointer) { - this->byteItemGraphicsScene->updateStackPointer(stackPointer); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->updateStackPointer(stackPointer); + } } void HexViewerWidget::resizeEvent(QResizeEvent* event) { @@ -199,38 +223,52 @@ namespace Bloom::Widgets this->highlightStackMemoryButton->setChecked(enabled); this->settings.highlightStackMemory = enabled; - this->byteItemGraphicsScene->invalidateChildItemCaches(); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->invalidateChildItemCaches(); + } } void HexViewerWidget::setHoveredRowAndColumnHighlightingEnabled(bool enabled) { this->highlightHoveredRowAndColumnButton->setChecked(enabled); this->settings.highlightHoveredRowAndCol = enabled; - this->byteItemGraphicsScene->invalidateChildItemCaches(); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->invalidateChildItemCaches(); + } } void HexViewerWidget::setFocusedMemoryHighlightingEnabled(bool enabled) { this->highlightFocusedMemoryButton->setChecked(enabled); this->settings.highlightFocusedMemory = enabled; - this->byteItemGraphicsScene->invalidateChildItemCaches(); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->invalidateChildItemCaches(); + } } void HexViewerWidget::setAnnotationsEnabled(bool enabled) { this->displayAnnotationsButton->setChecked(enabled); this->settings.displayAnnotations = enabled; - this->byteItemGraphicsScene->adjustSize(true); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->adjustSize(true); + } } void HexViewerWidget::setDisplayAsciiEnabled(bool enabled) { this->displayAsciiButton->setChecked(enabled); this->settings.displayAsciiValues = enabled; - this->byteItemGraphicsScene->invalidateChildItemCaches(); + if (this->byteItemGraphicsScene != nullptr) { + this->byteItemGraphicsScene->invalidateChildItemCaches(); + } } void HexViewerWidget::onGoToAddressInputChanged() { + if (this->byteItemGraphicsScene == nullptr) { + return; + } + auto addressConversionOk = false; const auto address = this->goToAddressInput->text().toUInt(&addressConversionOk, 16); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp index 2d874774..8682991a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp @@ -34,10 +34,14 @@ namespace Bloom::Widgets QWidget* parent ); + void init(); void updateValues(const Targets::TargetMemoryBuffer& buffer); void refreshRegions(); void setStackPointer(Targets::TargetStackPointer stackPointer); + signals: + void ready(); + protected: void resizeEvent(QResizeEvent* event) override; void showEvent(QShowEvent* event) override; @@ -53,6 +57,7 @@ namespace Bloom::Widgets QWidget* toolBar = nullptr; QWidget* bottomBar = nullptr; + Label* loadingHexViewerLabel = nullptr; QWidget* byteItemGraphicsViewContainer = nullptr; ByteItemContainerGraphicsView* byteItemGraphicsView = nullptr; ByteItemGraphicsScene* byteItemGraphicsScene = nullptr; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui index 828b5655..689238cd 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui @@ -178,11 +178,30 @@ + + + + + + + true + + + Qt::AlignCenter + + + Loading... + + + + + false + diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 7191cc54..f7b8e4db 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -89,6 +89,19 @@ namespace Bloom::Widgets containerLayout->insertWidget(1, this->hexViewerWidget); + QObject::connect( + this->hexViewerWidget, + &HexViewerWidget::ready, + this, + [this] { + if (this->data.has_value()) { + this->hexViewerWidget->updateValues(this->data.value()); + } + } + ); + + this->hexViewerWidget->init(); + this->setRefreshOnTargetStopEnabled(this->settings.refreshOnTargetStop); this->setRefreshOnActivationEnabled(this->settings.refreshOnActivation);