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

Method data

qrenderdoc/Windows/DebugMessageView.cpp:90–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
91 {
92 if(index.isValid() && (role == Qt::DisplayRole || role == SortDataRole))
93 {
94 bool sort = (role == SortDataRole);
95
96 int row = index.row();
97 int col = index.column();
98
99 if(col >= 0 && col < columnCount() && row < rowCount())
100 {
101 const DebugMessage &msg = m_Ctx.DebugMessages()[row];
102
103 switch(col)
104 {
105 case 0: return msg.eventId;
106 case 1: return ToQStr(msg.source);
107 case 2: return sort ? QVariant((uint32_t)msg.severity) : QVariant(ToQStr(msg.severity));
108 case 3: return ToQStr(msg.category);
109 case 4: return msg.messageID;
110 case 5:
111 {
112 QVariant desc = msg.description;
113 RichResourceTextInitialise(desc, &m_Ctx, true);
114 return desc;
115 }
116 default: break;
117 }
118 }
119 }
120
121 if(index.isValid() && role == EIDRole && index.row() >= 0 &&
122 index.row() < m_Ctx.DebugMessages().count())
123 return m_Ctx.DebugMessages()[index.row()].eventId;
124
125 return QVariant();
126 }
127
128private:
129 ICaptureContext &m_Ctx;

Callers 2

lessThanMethod · 0.45

Calls 9

columnCountFunction · 0.50
rowCountFunction · 0.50
ToQStrFunction · 0.50
QVariantClass · 0.50
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected