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

Method setData

qrenderdoc/Windows/Dialogs/ConfigEditor.cpp:175–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173 }
174
175 bool setData(const QModelIndex &index, const QVariant &val, int role) override
176 {
177 SDObject *o = NULL;
178
179 if(role == Qt::UserRole)
180 {
181 // if we have setData for user role, that means we got reset. Just need to emit data changed
182 o = obj(index);
183 }
184 else if(index.column() == Column_Value)
185 {
186 o = obj(index);
187
188 SDObject *value = o->FindChild("value");
189
190 if(role == Qt::CheckStateRole && value)
191 {
192 value->data.basic.b = (val.toInt() == Qt::CheckState::Checked);
193 }
194 else
195 {
196 // didn't change anything we care about
197 o = NULL;
198 }
199 }
200
201 if(o)
202 {
203 // dataChanged this index and all parents (in case a section became non-customised, or
204 // customised, and it wasn't before)
205 QModelIndex idx = index;
206 while(idx.isValid())
207 {
208 o = obj(idx);
209 emit dataChanged(createIndex(idx.row(), 0, o), createIndex(idx.row(), Column_Count, o),
210 {Qt::DisplayRole, Qt::CheckStateRole, Qt::FontRole});
211
212 idx = parents[o];
213 }
214
215 return true;
216 }
217
218 return false;
219 }
220
221 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
222 {

Callers 15

LogViewMethod · 0.45
messages_refreshMethod · 0.45
InspectMethod · 0.45
FillRemotesMenuMethod · 0.45
refreshMessagesMethod · 0.45
childUpdateMethod · 0.45
AddCaptureMethod · 0.45
editorEventMethod · 0.45
createEditorMethod · 0.45
uncheckAllChildrenMethod · 0.45
checkAllChildrenMethod · 0.45

Calls 4

createIndexFunction · 0.85
columnMethod · 0.45
isValidMethod · 0.45
rowMethod · 0.45

Tested by 1

InspectMethod · 0.36