Fixed bug with FocusedRegionGroupItem not correctly updating the contained byte items
This commit is contained in:
@@ -28,6 +28,27 @@ namespace Bloom::Widgets
|
||||
}
|
||||
}
|
||||
|
||||
FocusedRegionGroupItem::~FocusedRegionGroupItem() {
|
||||
const auto updateChildItems = [] (const decltype(this->items)& items, const auto& updateChildItems) -> void {
|
||||
for (auto& item : items) {
|
||||
auto* byteItem = dynamic_cast<ByteItem*>(item);
|
||||
|
||||
if (byteItem != nullptr) {
|
||||
byteItem->grouped = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto* groupItem = dynamic_cast<GroupItem*>(item);
|
||||
|
||||
if (groupItem != nullptr) {
|
||||
updateChildItems(groupItem->items, updateChildItems);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
updateChildItems(this->items, updateChildItems);
|
||||
}
|
||||
|
||||
void FocusedRegionGroupItem::refreshValue(const HexViewerSharedState& hexViewerState) {
|
||||
if (!hexViewerState.data.has_value()) {
|
||||
this->valueLabel = std::nullopt;
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace Bloom::Widgets
|
||||
HexViewerItem* parent
|
||||
);
|
||||
|
||||
~FocusedRegionGroupItem();
|
||||
|
||||
void refreshValue(const HexViewerSharedState& hexViewerState);
|
||||
|
||||
void paint(
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace Bloom::Widgets
|
||||
class GroupItem: public HexViewerItem
|
||||
{
|
||||
public:
|
||||
std::vector<HexViewerItem*> items;
|
||||
|
||||
~GroupItem();
|
||||
|
||||
QSize size() const override {
|
||||
@@ -35,7 +37,6 @@ namespace Bloom::Widgets
|
||||
}
|
||||
|
||||
protected:
|
||||
std::vector<HexViewerItem*> items;
|
||||
QSize groupSize = {};
|
||||
bool multiLine = false;
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Bloom::Widgets
|
||||
}
|
||||
|
||||
byteItem.parent = this;
|
||||
byteItem.grouped = false;
|
||||
this->items.push_back(&byteItem);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user