| 319 | } |
| 320 | |
| 321 | QModelIndex OutputModel::nextHighlightIndex( const QModelIndex ¤tIdx ) |
| 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 | |
| 349 | QModelIndex OutputModel::previousHighlightIndex( const QModelIndex ¤tIdx ) |
| 350 | { |
no test coverage detected