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

Method data

qrenderdoc/Windows/LogView.cpp:101–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
102 {
103 if(index.isValid())
104 {
105 int row = index.row();
106 int col = index.column();
107
108 if(col >= 0 && col < columnCount() && row < rowCount())
109 {
110 const LogMessage &msg = m_Viewer->m_Messages[row];
111
112 if(role == Qt::DisplayRole)
113 {
114 switch(col)
115 {
116 case Column_Source: return msg.Source;
117 case Column_PID: return QString::number(msg.PID);
118 case Column_Timestamp: return msg.Timestamp.toString(lit("HH:mm:ss"));
119 case Column_Location: return msg.Location;
120 case Column_Type: return ToQStr(msg.Type);
121 case Column_Message:
122 {
123 QVariant desc = msg.Message;
124 RichResourceTextInitialise(desc, &m_Viewer->m_Ctx);
125 return desc;
126 }
127 default: break;
128 }
129 }
130 else if(msg.Type == LogType::Error)
131 {
132 if(role == Qt::BackgroundRole)
133 return QBrush(QColor(255, 70, 70));
134 if(role == Qt::ForegroundRole)
135 return QBrush(QColor(0, 0, 0));
136 }
137 }
138 }
139
140 return QVariant();
141 }
142
143private:
144 LogView *m_Viewer;

Callers 15

MakeEditorMethod · 0.45
evaluateVarMethod · 0.45
updateWatchVariableMethod · 0.45
insertSnippetMethod · 0.45
on_resetEdits_clickedMethod · 0.45
findMethod · 0.45
performFindAllMethod · 0.45
performReplaceMethod · 0.45
performReplaceAllMethod · 0.45

Calls 11

columnCountFunction · 0.50
rowCountFunction · 0.50
ToQStrFunction · 0.50
QBrushClass · 0.50
QColorFunction · 0.50
QVariantClass · 0.50
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected