MCPcopy Create free account
hub / github.com/KDAB/GammaRay / selectionModel

Method selectionModel

common/objectbroker.cpp:164–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164QItemSelectionModel *ObjectBroker::selectionModel(QAbstractItemModel *model)
165{
166 auto it = s_objectBroker()->selectionModels.constFind(model);
167 if (it != s_objectBroker()->selectionModels.constEnd())
168 return it.value();
169
170 if (s_objectBroker()->selectionCallback) {
171 QAbstractItemModel *sourceModel = sourceModelForProxy(model);
172
173 QItemSelectionModel *selectionModel = nullptr;
174 if (sourceModel == model) {
175 selectionModel = s_objectBroker()->selectionCallback(sourceModel);
176 s_objectBroker()->ownedObjects.push_back(selectionModel);
177 } else {
178 QItemSelectionModel *sourceSelectionModel = ObjectBroker::selectionModel(sourceModel);
179 selectionModel = new KLinkItemSelectionModel(model, sourceSelectionModel, model);
180 }
181
182 if (selectionModel) {
183 registerSelectionModel(selectionModel);
184 return selectionModel;
185 }
186 }
187 return nullptr;
188}
189
190void ObjectBroker::setSelectionModelFactoryCallback(
191 ObjectBroker::selectionModelFactoryCallback callback)

Callers 15

AttachDialogMethod · 0.45
ConnectPageMethod · 0.45
instanceSelectedMethod · 0.45
SelectionModelSyncerMethod · 0.45
InspectorWidgetMethod · 0.45
eventFilterMethod · 0.45
ModelInspectorWidgetMethod · 0.45
NetworkReplyWidgetMethod · 0.45
eventFilterMethod · 0.45

Calls 3

sourceModelForProxyFunction · 0.85
constEndMethod · 0.45
valueMethod · 0.45

Tested by 8

InspectorWidgetMethod · 0.36
eventFilterMethod · 0.36
ModelInspectorWidgetMethod · 0.36
eventFilterMethod · 0.36
WidgetInspectorWidgetMethod · 0.36
updateActionsMethod · 0.36
updateActionsMethod · 0.36