Register std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*> meta type

This commit is contained in:
Nav
2023-01-14 12:53:57 +00:00
parent 7e08da1122
commit c35565bcd0
3 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
#include "ConstructHexViewerByteItems.hpp"
#include <QMetaType>
namespace Bloom
{
ConstructHexViewerByteItems::ConstructHexViewerByteItems(
@@ -14,7 +16,9 @@ namespace Bloom
, hoveredByteItem(hoveredByteItem)
, highlightedByteItems(highlightedByteItems)
, settings(settings)
{}
{
qRegisterMetaType<std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*>>();
}
void ConstructHexViewerByteItems::run(TargetController::TargetControllerConsole&) {
const auto memorySize = this->memoryDescriptor.size();
@@ -36,6 +40,6 @@ namespace Bloom
);
}
emit this->byteItems(this->byteItemsByAddress);
emit this->byteItems(std::move(this->byteItemsByAddress));
}
}

View File

@@ -34,7 +34,7 @@ namespace Bloom
signals:
void sceneCreated(Widgets::ByteItemGraphicsScene* scene);
void byteItems(std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*>& byteItemsByAddress);
void byteItems(std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*> byteItemsByAddress);
protected:
void run(TargetController::TargetControllerConsole&) override;

View File

@@ -128,7 +128,7 @@ namespace Bloom::Widgets
constructByteItemsTask,
&ConstructHexViewerByteItems::byteItems,
this,
[this] (std::map<Targets::TargetMemoryAddress, ByteItem*>& byteItemsByAddress) {
[this] (std::map<Targets::TargetMemoryAddress, ByteItem*> byteItemsByAddress) {
this->byteItemsByAddress = std::move(byteItemsByAddress);
for (const auto& [address, byteItem] : this->byteItemsByAddress) {