| 412 | } |
| 413 | |
| 414 | QQuickItem *QuickSceneGraphModel::itemForSgNode(QSGNode *node) const |
| 415 | { |
| 416 | while (node && !contains(m_itemNodeItemMap, node)) { |
| 417 | // If there's no entry for node, take its parent |
| 418 | auto it = m_childParentMap.find(node); |
| 419 | if (it == m_childParentMap.end()) { |
| 420 | // Can happen if the node belongs to another window and itemForSgNode() gets |
| 421 | // called during window selection change |
| 422 | return nullptr; |
| 423 | } else { |
| 424 | node = it->second; |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | auto it = m_itemNodeItemMap.find(node); |
| 429 | if (it != m_itemNodeItemMap.end()) { |
| 430 | return it->second; |
| 431 | } |
| 432 | return nullptr; |
| 433 | } |
| 434 | |
| 435 | bool QuickSceneGraphModel::verifyNodeValidity(QSGNode *node) |
| 436 | { |