| 492 | } |
| 493 | |
| 494 | void 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 | |
| 532 | void OutputWidget::activate(const QModelIndex& index) |
| 533 | { |
nothing calls this directly
no test coverage detected