MCPcopy Create free account
hub / github.com/begla/Intrinsic / onDestroyComponent

Method onDestroyComponent

IntrinsicEd/src/IntrinsicEdNodeViewTreeWidget.cpp:282–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void IntrinsicEdNodeViewTreeWidget::onDestroyComponent()
283{
284 QTreeWidgetItem* currIt = currentItem();
285 Components::NodeRef currentNode = _itemToNodeMap[currIt];
286 Entity::EntityRef entity = Components::NodeManager::_entity(currentNode);
287
288 QAction* action = (QAction*)QObject::sender();
289 _INTR_STRING compName = action->text().toStdString().c_str();
290 Dod::Components::ComponentManagerEntry& entry =
291 Application::_componentManagerMapping[compName];
292 Dod::Ref componentRef = entry.getComponentForEntityFunction(entity);
293
294 if (entry.destroyResourcesFunction)
295 {
296 Dod::RefArray components;
297 components.push_back(componentRef);
298 entry.destroyResourcesFunction(components);
299 }
300
301 _INTR_ASSERT(entry.destroyFunction);
302 entry.destroyFunction(componentRef);
303
304 if (entry.onInsertionDeletionFinishedAction)
305 {
306 entry.onInsertionDeletionFinishedAction();
307 }
308
309 onItemSelected(currIt, nullptr);
310 onPopulateNodeTree();
311}
312
313void IntrinsicEdNodeViewTreeWidget::onShowContextMenuForTreeView(QPoint p_Pos)
314{

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected