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

Method nextHighlightIndex

kdevplatform/outputview/outputmodel.cpp:321–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321QModelIndex OutputModel::nextHighlightIndex( const QModelIndex &currentIdx )
322{
323 Q_D(OutputModel);
324
325 int startrow = d->isValidIndex(currentIdx, rowCount()) ? currentIdx.row() + 1 : 0;
326
327 if( !d->m_errorItems.empty() )
328 {
329 qCDebug(OUTPUTVIEW) << "searching next error";
330 // Jump to the next error item
331 auto next = d->m_errorItems.lower_bound( startrow );
332 if( next == d->m_errorItems.end() )
333 next = d->m_errorItems.begin();
334
335 return index( *next, 0, QModelIndex() );
336 }
337
338 for( int row = 0; row < rowCount(); ++row )
339 {
340 int currow = (startrow + row) % rowCount();
341 if( d->m_filteredItems.at( currow ).isActivatable )
342 {
343 return index( currow, 0, QModelIndex() );
344 }
345 }
346 return QModelIndex();
347}
348
349QModelIndex OutputModel::previousHighlightIndex( const QModelIndex &currentIdx )
350{

Callers 1

selectItemMethod · 0.80

Calls 8

isValidIndexMethod · 0.80
emptyMethod · 0.80
QModelIndexClass · 0.70
indexFunction · 0.50
rowMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected