Off-loaded ByteItemGraphicsScene construction to Insight worker task
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#include "ConstructHexViewerByteItemScene.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
ConstructHexViewerByteItemScene::ConstructHexViewerByteItemScene(
|
||||
const Targets::TargetMemoryDescriptor& memoryDescriptor,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& 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);
|
||||
}
|
||||
}
|
||||
@@ -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<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& 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<FocusedMemoryRegion>& focusedMemoryRegions;
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions;
|
||||
const Widgets::HexViewerWidgetSettings& settings;
|
||||
Widgets::Label* hoveredAddressLabel;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user