| 246 | } |
| 247 | |
| 248 | void IntrinsicEdNodeViewTreeWidget::onCreateComponent() |
| 249 | { |
| 250 | QTreeWidgetItem* currIt = currentItem(); |
| 251 | Components::NodeRef currentNode = _itemToNodeMap[currIt]; |
| 252 | Entity::EntityRef entity = Components::NodeManager::_entity(currentNode); |
| 253 | |
| 254 | QAction* action = (QAction*)QObject::sender(); |
| 255 | _INTR_STRING compName = action->text().toStdString().c_str(); |
| 256 | Dod::Components::ComponentManagerEntry& entry = |
| 257 | Application::_componentManagerMapping[compName]; |
| 258 | |
| 259 | _INTR_ASSERT(entry.createFunction); |
| 260 | Dod::Ref compRef = entry.createFunction(entity); |
| 261 | |
| 262 | if (entry.resetToDefaultFunction) |
| 263 | { |
| 264 | entry.resetToDefaultFunction(compRef); |
| 265 | } |
| 266 | |
| 267 | if (entry.createResourcesFunction) |
| 268 | { |
| 269 | Dod::RefArray components = {compRef}; |
| 270 | entry.createResourcesFunction(components); |
| 271 | } |
| 272 | |
| 273 | if (entry.onInsertionDeletionFinishedAction) |
| 274 | { |
| 275 | entry.onInsertionDeletionFinishedAction(); |
| 276 | } |
| 277 | |
| 278 | onItemSelected(currIt, nullptr); |
| 279 | onPopulateNodeTree(); |
| 280 | } |
| 281 | |
| 282 | void IntrinsicEdNodeViewTreeWidget::onDestroyComponent() |
| 283 | { |
nothing calls this directly
no outgoing calls
no test coverage detected