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

Method data

qrenderdoc/Windows/Dialogs/ConfigEditor.cpp:221–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 }
220
221 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
222 {
223 if(index.isValid())
224 {
225 SDObject *o = obj(index);
226 int col = index.column();
227
228 SDObject *value = o->FindChild("value");
229
230 if(role == Qt::UserRole)
231 {
232 return QVariant::fromValue((quintptr)o);
233 }
234 else if(role == Qt::DisplayRole)
235 {
236 switch(col)
237 {
238 case Column_Name: return o->name;
239 case Column_Value:
240 return value && value->type.basetype != SDBasic::Boolean ? valueString(value)
241 : QVariant();
242 case Column_ResetButton: return anyChildChanged(o) ? lit("...") : QVariant();
243 default: break;
244 }
245 }
246 else if(role == Qt::CheckStateRole && col == Column_Value)
247 {
248 if(value && value->type.basetype == SDBasic::Boolean)
249 return value->data.basic.b ? Qt::CheckState::Checked : Qt::CheckState::Unchecked;
250 return QVariant();
251 }
252 else if(role == Qt::TextAlignmentRole && col == Column_ResetButton)
253 {
254 return Qt::AlignHCenter + Qt::AlignTop;
255 }
256 else if(role == Qt::ToolTipRole)
257 {
258 SDObject *desc = o->FindChild("description");
259 if(desc)
260 {
261 rdcstr ret = desc->AsString();
262
263 if(o->FindChild("key") == NULL)
264 {
265 ret =
266 "WARNING: Unknown setting, possibly it has been removed or from a different "
267 "build.\n\n" +
268 ret;
269 }
270
271 return ret;
272 }
273 }
274 else if(role == Qt::FontRole)
275 {
276 if(anyChildChanged(o))
277 {
278 QFont font;

Callers 15

EditDecompiledSourceMethod · 0.45
SaveShaderFileMethod · 0.45
EncodeFossilizeVarintMethod · 0.45
exportFOZMethod · 0.45
CrashDialogMethod · 0.45
sendReportMethod · 0.45
refreshHostMethod · 0.45
childUpdateMethod · 0.45
GetCaptureMethod · 0.45
captureAddedMethod · 0.45

Calls 8

fromValueFunction · 0.85
anyChildChangedFunction · 0.85
valueStringFunction · 0.70
QVariantClass · 0.50
isValidMethod · 0.45
columnMethod · 0.45
setBoldMethod · 0.45
setItalicMethod · 0.45

Tested by

no test coverage detected