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

Method activateIndex

plugins/standardoutputview/outputwidget.cpp:448–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void OutputWidget::activateIndex(const QModelIndex &index, QAbstractItemView *view, KDevelop::IOutputViewModel *iface)
449{
450 if( ! index.isValid() )
451 return;
452 QModelIndex sourceIndex = index;
453 QModelIndex viewIndex = index;
454 const auto fvIt = constFindFilteredView(view);
455 if (fvIt != m_views.cend() && fvIt->proxyModel) {
456 auto proxy = fvIt->proxyModel;
457 if ( index.model() == proxy ) {
458 // index is from the proxy, map it to the source
459 sourceIndex = proxy->mapToSource(index);
460 } else if (proxy == view->model()) {
461 // index is from the source, map it to the proxy
462 viewIndex = proxy->mapFromSource(index);
463 }
464 }
465
466 view->setCurrentIndex( viewIndex );
467 view->scrollTo( viewIndex );
468
469 if( m_activateOnSelect->isChecked() ) {
470 iface->activate( sourceIndex );
471 }
472}
473
474void OutputWidget::selectFirstItem()
475{

Callers

nothing calls this directly

Calls 6

setCurrentIndexMethod · 0.80
isValidMethod · 0.45
modelMethod · 0.45
mapToSourceMethod · 0.45
mapFromSourceMethod · 0.45
activateMethod · 0.45

Tested by

no test coverage detected