MCPcopy Create free account
hub / github.com/KDE/kdevelop / data

Method data

kdevplatform/sublime/aggregatemodel.cpp:125–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125QVariant AggregateModel::data(const QModelIndex &index, int role) const
126{
127 Q_D(const AggregateModel);
128
129 if (!index.isValid() || (role != Qt::DisplayRole))
130 return QVariant();
131
132 if (!index.parent().isValid())
133 {
134 //aggregator item
135 return d->modelNames[d->modelList[index.row()]];
136 }
137 else
138 {
139 //we have a standard item in the source model - just map it into our model
140 auto *item = static_cast<QStandardItem*>(index.internalPointer());
141 return item->data(role);
142 }
143}
144
145QModelIndex AggregateModel::parent(const QModelIndex &index) const
146{

Callers 13

findActionInsertionPointFunction · 0.45
AreaPrivateMethod · 0.45
activeViewMethod · 0.45
indexOfMethod · 0.45
rootIndexMethod · 0.45
viewsMethod · 0.45
closeViewMethod · 0.45
fetchToolBarForMethod · 0.45
checkAreaViewsDisplayMethod · 0.45

Calls 4

QVariantClass · 0.50
isValidMethod · 0.45
parentMethod · 0.45
rowMethod · 0.45

Tested by 4

fetchToolBarForMethod · 0.36
checkAreaViewsDisplayMethod · 0.36
viewActivationMethod · 0.36