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

Method selectItem

plugins/standardoutputview/outputwidget.cpp:494–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void OutputWidget::selectItem(SelectionMode selectionMode)
495{
496 auto view = outputView();
497 auto iface = outputViewModel();
498 if ( ! view || ! iface )
499 return;
500 eventuallyDoFocus();
501
502 auto index = view->currentIndex();
503 const auto fvIt = constFindFilteredView(view);
504 if (fvIt != m_views.cend() && fvIt->proxyModel) {
505 auto proxy = fvIt->proxyModel;
506 if ( index.model() == proxy ) {
507 // index is from the proxy, map it to the source
508 index = proxy->mapToSource(index);
509 }
510 }
511
512 QModelIndex newIndex;
513 switch (selectionMode) {
514 case First:
515 newIndex = iface->firstHighlightIndex();
516 break;
517 case Next:
518 newIndex = iface->nextHighlightIndex( index );
519 break;
520 case Previous:
521 newIndex = iface->previousHighlightIndex( index );
522 break;
523 case Last:
524 newIndex = iface->lastHighlightIndex();
525 break;
526 }
527
528 qCDebug(PLUGIN_STANDARDOUTPUTVIEW) << "old:" << index << "- new:" << newIndex;
529 activateIndex(newIndex, view, iface);
530}
531
532void OutputWidget::activate(const QModelIndex& index)
533{

Callers

nothing calls this directly

Calls 7

firstHighlightIndexMethod · 0.80
nextHighlightIndexMethod · 0.80
lastHighlightIndexMethod · 0.80
currentIndexMethod · 0.45
modelMethod · 0.45
mapToSourceMethod · 0.45

Tested by

no test coverage detected