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

Method data

qrenderdoc/Windows/EventBrowser.cpp:743–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741 }
742
743 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
744 {
745 if(!index.isValid())
746 return QVariant();
747
748 if(role == Qt::DecorationRole)
749 {
750 if(index == m_CurrentEID)
751 return Icons::flag_green();
752 else if(m_BookmarkIndices.contains(index))
753 return Icons::asterisk_orange();
754 else if(m_FindResults.contains(index))
755 return Icons::find();
756 return QVariant();
757 }
758
759 if(index.column() == COL_DURATION && role == Qt::TextAlignmentRole)
760 return int(Qt::AlignRight | Qt::AlignVCenter);
761
762 if(index.column() == COL_ANNOTATION && role == Qt::ToolTipRole)
763 return m_AnnotationPath.empty() ? lit("-") : QString(m_AnnotationPath);
764
765 if(index.internalId() == TagRoot)
766 {
767 if(role == Qt::DisplayRole && index.column() == COL_NAME)
768 {
769 uint32_t frameNumber = m_Ctx.FrameInfo().frameNumber;
770 return frameNumber == ~0U ? tr("User-defined Capture") : tr("Frame #%1").arg(frameNumber);
771 }
772
773 if(role == ROLE_SELECTED_EID)
774 return 0;
775
776 if(role == ROLE_EFFECTIVE_EID)
777 return m_Nodes[0].effectiveEID;
778
779 if(index.column() == COL_DURATION && role == Qt::DisplayRole)
780 return FormatDuration(0);
781
782 if(index.column() == COL_ANNOTATION && role == Qt::DisplayRole)
783 return QString();
784 }
785 else if(index.internalId() == TagCaptureStart)
786 {
787 if(role == Qt::DisplayRole)
788 {
789 switch(index.column())
790 {
791 case COL_NAME: return tr("Capture Start");
792 case COL_EID: return lit("0");
793 case COL_ACTION: return lit("0");
794 default: break;
795 }
796 }
797
798 if(role == ROLE_SELECTED_EID || role == ROLE_EFFECTIVE_EID)
799 return 0;
800

Callers 7

GetSelectedEIDFunction · 0.45
GetEffectiveEIDFunction · 0.45
FindNextMethod · 0.45
filter_applyMethod · 0.45
GetExportStringMethod · 0.45
ExportActionMethod · 0.45

Calls 15

fromValueFunction · 0.85
SDObject2VariantFunction · 0.85
qRgbFunction · 0.85
contrastingColorFunction · 0.85
paletteMethod · 0.80
QVariantClass · 0.50
findFunction · 0.50
QStringFunction · 0.50
trFunction · 0.50
QBrushClass · 0.50
isValidMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected