Remove expensive calls to QGraphicsItemGroup::removefromGroup

This commit is contained in:
GriffinR
2025-04-03 16:22:26 -04:00
parent cdd7e74e7f
commit a898791a70

View File

@@ -1673,10 +1673,9 @@ void Editor::clearMapEvents() {
if (events_group->scene()) {
events_group->scene()->removeItem(events_group);
}
for (QGraphicsItem *child : events_group->childItems()) {
events_group->removeFromGroup(child);
delete child;
}
// events_group does not own its children, the childrens' parent
// is set to the group's parent (and our group has no parent).
qDeleteAll(events_group->childItems());
delete events_group;
events_group = nullptr;
}