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

Function findSourceModel

common/networkselectionmodel.cpp:47–59  ·  view source on GitHub ↗

find a model having a defaultSelectedItem method

Source from the content-addressed store, hash-verified

45
46// find a model having a defaultSelectedItem method
47static QAbstractItemModel *findSourceModel(QAbstractItemModel *model)
48{
49 if (model) {
50 if (model->metaObject()->indexOfMethod(QMetaObject::normalizedSignature(
51 "defaultSelectedItem()"))
52 != -1)
53 return model;
54 if (auto proxy = qobject_cast<QAbstractProxyModel *>(model))
55 return findSourceModel(proxy->sourceModel());
56 }
57
58 return nullptr;
59}
60
61NetworkSelectionModel::NetworkSelectionModel(const QString &objectName, QAbstractItemModel *model,
62 QObject *parent)

Callers 1

sendSelectionMethod · 0.85

Calls 1

metaObjectMethod · 0.45

Tested by

no test coverage detected