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

Method index

qrenderdoc/Windows/EventBrowser.cpp:631–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629 // QAbstractItemModel methods
630
631 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override
632 {
633 if(!m_Ctx.IsCaptureLoaded())
634 return QModelIndex();
635
636 // create fake root if the parent is invalid
637 if(!parent.isValid())
638 return createIndex(0, column, TagRoot);
639
640 // if the parent is the root, return the index for the specified child if it's in bounds
641 if(parent.internalId() == TagRoot)
642 {
643 // first child is the capture start
644 if(row == 0)
645 return createIndex(row, column, TagCaptureStart);
646
647 // the rest are in the root action node
648 return GetIndexForActionChildRow(m_Nodes[0], row, column);
649 }
650 else if(parent.internalId() == TagCaptureStart)
651 {
652 // no children for this
653 return QModelIndex();
654 }
655 else
656 {
657 // otherwise the parent is a real action
658 auto it = m_Nodes.find(parent.internalId());
659 if(it != m_Nodes.end())
660 return GetIndexForActionChildRow(*it, row, column);
661 }
662
663 return QModelIndex();
664 }
665
666 QModelIndex parent(const QModelIndex &index) const override
667 {

Callers 4

filterAcceptsRowMethod · 0.45
OnCaptureLoadedMethod · 0.45

Calls 6

createIndexFunction · 0.85
QModelIndexClass · 0.50
IsCaptureLoadedMethod · 0.45
isValidMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected