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

Method data

kdevplatform/project/projectbuildsetmodel.cpp:250–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250QVariant ProjectBuildSetModel::data( const QModelIndex& idx, int role ) const
251{
252 Q_D(const ProjectBuildSetModel);
253
254 if( !idx.isValid() || idx.row() < 0 || idx.column() < 0
255 || idx.row() >= rowCount() || idx.column() >= columnCount())
256 {
257 return QVariant();
258 }
259
260 if(role == Qt::DisplayRole) {
261 switch( idx.column() )
262 {
263 case 0:
264 return d->items.at(idx.row()).itemName();
265 case 1:
266 return KDevelop::joinWithEscaping(d->items.at(idx.row()).itemPath(), QLatin1Char('/'), QLatin1Char('\\'));
267 }
268 } else if(role == Qt::DecorationRole && idx.column()==0) {
269 KDevelop::ProjectBaseItem* item = d->items.at(idx.row()).findItem();
270 if( item ) {
271 return QIcon::fromTheme( item->iconName() );
272 }
273 }
274 return QVariant();
275}
276
277QVariant ProjectBuildSetModel::headerData( int section, Qt::Orientation orientation, int role ) const
278{

Callers

nothing calls this directly

Calls 10

joinWithEscapingFunction · 0.85
itemNameMethod · 0.80
QVariantClass · 0.50
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
atMethod · 0.45
itemPathMethod · 0.45
findItemMethod · 0.45
iconNameMethod · 0.45

Tested by

no test coverage detected