MCPcopy Create free account
hub / github.com/baldurk/renderdoc / parent

Method parent

qrenderdoc/Windows/EventBrowser.cpp:666–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664 }
665
666 QModelIndex parent(const QModelIndex &index) const override
667 {
668 if(!m_Ctx.IsCaptureLoaded() || !index.isValid() || index.internalId() == TagRoot)
669 return QModelIndex();
670
671 // Capture Start's parent is the root
672 if(index.internalId() == TagCaptureStart)
673 return createIndex(0, 0, TagRoot);
674
675 if(index.internalId() >= m_Actions.size())
676 return QModelIndex();
677
678 // otherwise it's an action
679 const ActionDescription *action = m_Actions[index.internalId()];
680
681 // if it has no parent action, the parent is the root
682 if(action->parent == NULL)
683 return createIndex(0, 0, TagRoot);
684
685 // the parent must be a node since it has at least one child (this action), so we'll have a
686 // cached
687 // index
688 return m_Nodes[action->parent->eventId].index;
689 }
690
691 int rowCount(const QModelIndex &parent = QModelIndex()) const override
692 {

Callers 1

ExpandNodeMethod · 0.45

Calls 5

createIndexFunction · 0.85
QModelIndexClass · 0.50
IsCaptureLoadedMethod · 0.45
isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected