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

Method editorEvent

qrenderdoc/Windows/Dialogs/ConfigEditor.cpp:447–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447bool SettingDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
448 const QStyleOptionViewItem &option, const QModelIndex &index)
449{
450 if(event->type() == QEvent::MouseButtonRelease && index.column() == SettingModel::Column_ResetButton)
451 {
452 SDObject *o = (SDObject *)index.data(Qt::UserRole).toULongLong();
453
454 SDObject *def = o->FindChild("default");
455 SDObject *val = o->FindChild("value");
456
457 if(def && val)
458 {
459 val->data.str = def->data.str;
460 memcpy(&val->data.basic, &def->data.basic, sizeof(val->data.basic));
461
462 val->DeleteChildren();
463
464 for(size_t c = 0; c < def->NumChildren(); c++)
465 val->DuplicateAndAddChild(def->GetChild(c));
466
467 // call setData() to emit the dataChanged for this element and all parents
468 model->setData(index, QVariant(), Qt::UserRole);
469
470 return true;
471 }
472 }
473
474 return QStyledItemDelegate::editorEvent(event, model, option, index);
475}
476
477QWidget *SettingDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
478 const QModelIndex &index) const

Callers

nothing calls this directly

Calls 9

DeleteChildrenMethod · 0.80
DuplicateAndAddChildMethod · 0.80
memcpyFunction · 0.50
QVariantClass · 0.50
typeMethod · 0.45
columnMethod · 0.45
dataMethod · 0.45
GetChildMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected