diff --git a/plugins/quickopen/expandingtree/expandingdelegate.cpp b/plugins/quickopen/expandingtree/expandingdelegate.cpp --- a/plugins/quickopen/expandingtree/expandingdelegate.cpp +++ b/plugins/quickopen/expandingtree/expandingdelegate.cpp @@ -78,11 +78,12 @@ adjustStyle(index, option); + const QModelIndex sourceIndex = model()->mapToSource(index); if( index.column() == 0 ) - model()->placeExpandingWidget(index); + model()->placeExpandingWidget(sourceIndex); //Make sure the decorations are painted at the top, because the center of expanded items will be filled with the embedded widget. - if( model()->isPartiallyExpanded(index) == ExpandingWidgetModel::ExpandUpwards ) + if( model()->isPartiallyExpanded(sourceIndex) == ExpandingWidgetModel::ExpandUpwards ) m_cachedAlignment = Qt::AlignBottom; else m_cachedAlignment = Qt::AlignTop; @@ -95,7 +96,7 @@ m_cachedHighlights.clear(); m_backgroundColor = getUsedBackgroundColor(option, index); - if (model()->indexIsItem(index) ) { + if (model()->indexIsItem(sourceIndex) ) { m_currentColumnStart = 0; m_cachedHighlights = createHighlighting(index, option); } @@ -108,8 +109,8 @@ ///This is a bug workaround for the Qt raster paint engine: It paints over widgets embedded into the viewport when updating due to mouse events ///@todo report to Qt Software - if( model()->isExpanded(index) && model()->expandingWidget( index ) ) - model()->expandingWidget( index )->update(); + if( model()->isExpanded(sourceIndex) && model()->expandingWidget( sourceIndex ) ) + model()->expandingWidget( sourceIndex )->update(); } QList ExpandingDelegate::createHighlighting(const QModelIndex& index, QStyleOptionViewItem& option) const { @@ -124,14 +125,15 @@ QSize ExpandingDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const { + const QModelIndex sourceIndex = model()->mapToSource(index); QSize s = QItemDelegate::sizeHint( option, index ); - if( model()->isExpanded(index) && model()->expandingWidget( index ) ) + if( model()->isExpanded(sourceIndex) && model()->expandingWidget(sourceIndex) ) { - QWidget* widget = model()->expandingWidget( index ); + QWidget* widget = model()->expandingWidget( sourceIndex ); QSize widgetSize = widget->size(); s.setHeight( widgetSize.height() + s.height() + 10 ); //10 is the sum that must match exactly the offsets used in ExpandingWidgetModel::placeExpandingWidgets - } else if( model()->isPartiallyExpanded( index ) != ExpandingWidgetModel::ExpansionType::NotExpanded) { + } else if( model()->isPartiallyExpanded( sourceIndex ) != ExpandingWidgetModel::ExpansionType::NotExpanded) { s.setHeight( s.height() + 30 + 10 ); } return s; @@ -143,11 +145,13 @@ Q_UNUSED(option) } -void ExpandingDelegate::adjustRect(QRect& rect) const { - if (!model()->indexIsItem(m_currentIndex) /*&& m_currentIndex.column() == 0*/) { +void ExpandingDelegate::adjustRect(QRect& rect) const +{ + const QModelIndex sourceIndex = model()->mapToSource(m_currentIndex); + if (!model()->indexIsItem(sourceIndex) /*&& m_currentIndex.column() == 0*/) { rect.setLeft(model()->treeView()->columnViewportPosition(0)); - int columnCount = model()->columnCount(m_currentIndex.parent()); + int columnCount = model()->columnCount(sourceIndex.parent()); if(!columnCount) return; @@ -282,8 +286,10 @@ //qt_format_text(option.font, textRect, option.displayAlignment, str, 0, 0, 0, 0, painter); } -void ExpandingDelegate::drawDecoration(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QPixmap& pixmap) const { - if (model()->indexIsItem(m_currentIndex) ) +void ExpandingDelegate::drawDecoration(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QPixmap& pixmap) const +{ + const QModelIndex sourceIndex = model()->mapToSource(m_currentIndex); + if (model()->indexIsItem(sourceIndex)) QItemDelegate::drawDecoration(painter, option, rect, pixmap); } @@ -307,8 +313,9 @@ { if( event->type() == QEvent::MouseButtonRelease ) { + const QModelIndex sourceIndex = model()->mapToSource(index); event->accept(); - model()->setExpanded(index, !model()->isExpanded( index )); + model()->setExpanded(sourceIndex, !model()->isExpanded(sourceIndex)); heightChanged(); return true; diff --git a/plugins/quickopen/expandingtree/expandingtree.cpp b/plugins/quickopen/expandingtree/expandingtree.cpp --- a/plugins/quickopen/expandingtree/expandingtree.cpp +++ b/plugins/quickopen/expandingtree/expandingtree.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include "expandingwidgetmodel.h" @@ -39,10 +40,12 @@ void ExpandingTree::drawRow ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const { QTreeView::drawRow( painter, option, index ); - const ExpandingWidgetModel* eModel = qobject_cast(model()); - if( eModel && eModel->isPartiallyExpanded( index ) != ExpandingWidgetModel::ExpansionType::NotExpanded) + const ExpandingWidgetModel* eModel = qobject_cast( qobject_cast(model())->sourceModel()); + Q_ASSERT(eModel); + const QModelIndex sourceIndex = eModel->mapToSource(index); + if( eModel && eModel->isPartiallyExpanded( sourceIndex ) != ExpandingWidgetModel::ExpansionType::NotExpanded) { - QRect rect = eModel->partialExpandRect( index ); + QRect rect = eModel->partialExpandRect( sourceIndex ); if( rect.isValid() ) { painter->fillRect(rect,QBrush(0xffffffff)); @@ -54,7 +57,7 @@ painter->setViewTransformEnabled(true); painter->translate(rect.left(), rect.top()); - m_drawText.setHtml( eModel->partialExpandText( index ) ); + m_drawText.setHtml( eModel->partialExpandText( sourceIndex ) ); m_drawText.setPageSize(QSizeF(rect.width(), rect.height())); m_drawText.documentLayout()->draw( painter, ctx ); diff --git a/plugins/quickopen/expandingtree/expandingwidgetmodel.h b/plugins/quickopen/expandingtree/expandingwidgetmodel.h --- a/plugins/quickopen/expandingtree/expandingwidgetmodel.h +++ b/plugins/quickopen/expandingtree/expandingwidgetmodel.h @@ -26,6 +26,10 @@ #include #include #include +#include + +class ExpandingDelegate; +class ExpandingTree; class KWidget; class QTreeView; @@ -97,17 +101,19 @@ /// virtual void rowSelected(const QModelIndex & row); - ///Returns the rectangle for the partially expanded part of the given row + /// Returns the rectangle for the partially expanded part of the given row + /// TODO: Do this via QAIM roles? QRect partialExpandRect(const QModelIndex & row) const; + /// TODO: Do this via QAIM roles? QString partialExpandText(const QModelIndex & row) const; ///Places and shows the expanding-widget for the given row, if it should be visible and is valid. ///Also shows the partial-expanding-widget when it should be visible. void placeExpandingWidget(const QModelIndex & row); - + virtual QTreeView* treeView() const = 0; - + ///Should return true if the given row should be painted like a contained item(as opposed to label-rows etc.) virtual bool indexIsItem(const QModelIndex& index) const = 0; @@ -130,6 +136,9 @@ * */ virtual int contextMatchQuality(const QModelIndex & index) const = 0; + QModelIndex mapFromSource(const QModelIndex& index) const; + QModelIndex mapToSource(const QModelIndex& index) const; + //Makes sure m_expandedIcon and m_collapsedIcon are loaded void cacheIcons() const; @@ -142,6 +151,9 @@ int basicRowHeight( const QModelIndex& index ) const; private: + friend ExpandingDelegate; + friend ExpandingTree; + QMap m_partiallyExpanded; // Store expanding-widgets and cache whether items can be expanded mutable QMap m_expandState; diff --git a/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp b/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp --- a/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp +++ b/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp @@ -111,6 +111,22 @@ return QVariant(); } +QModelIndex ExpandingWidgetModel::mapFromSource(const QModelIndex& index) const +{ + const auto proxyModel = qobject_cast(treeView()->model()); + Q_ASSERT(proxyModel); + Q_ASSERT(index.model() == this); + return proxyModel->mapFromSource(index); +} + +QModelIndex ExpandingWidgetModel::mapToSource(const QModelIndex& index) const +{ + const auto proxyModel = qobject_cast(treeView()->model()); + Q_ASSERT(proxyModel); + Q_ASSERT(index.model() == proxyModel); + return proxyModel->mapToSource(index); +} + void ExpandingWidgetModel::clearMatchQualities() { m_contextMatchQualities.clear(); } @@ -157,6 +173,8 @@ void ExpandingWidgetModel::rowSelected(const QModelIndex& idx_) { + Q_ASSERT(idx_.model() == this); + QModelIndex idx( firstColumn(idx_) ); if( !m_partiallyExpanded.contains( idx ) ) { @@ -191,17 +209,18 @@ if( treeView()->verticalScrollMode() == QAbstractItemView::ScrollPerItem ) { + const QModelIndex viewIndex = mapFromSource(idx); //Qt fails to correctly scroll in ScrollPerItem mode, so the selected index is completely visible, //so we do the scrolling by hand. - QRect selectedRect = treeView()->visualRect(idx); + QRect selectedRect = treeView()->visualRect(viewIndex); QRect frameRect = treeView()->frameRect(); if( selectedRect.bottom() > frameRect.bottom() ) { int diff = selectedRect.bottom() - frameRect.bottom(); //We need to scroll down - QModelIndex newTopIndex = idx; + QModelIndex newTopIndex = viewIndex; - QModelIndex nextTopIndex = idx; + QModelIndex nextTopIndex = viewIndex; QRect nextRect = treeView()->visualRect(nextTopIndex); while( nextTopIndex.isValid() && nextRect.isValid() && nextRect.top() >= diff ) { newTopIndex = nextTopIndex; @@ -242,15 +261,20 @@ } } -QString ExpandingWidgetModel::partialExpandText(const QModelIndex& idx) const { +QString ExpandingWidgetModel::partialExpandText(const QModelIndex& idx) const +{ + Q_ASSERT(idx.model() == this); + if( !idx.isValid() ) return QString(); return data(firstColumn(idx), CodeCompletionModel::ItemSelected).toString(); } QRect ExpandingWidgetModel::partialExpandRect(const QModelIndex& idx_) const { + Q_ASSERT(idx_.model() == this); + QModelIndex idx(firstColumn(idx_)); if( !idx.isValid() ) @@ -262,12 +286,13 @@ expansion = m_partiallyExpanded[idx]; //Get the whole rectangle of the row: - QModelIndex rightMostIndex = idx; - QModelIndex tempIndex = idx; + const QModelIndex viewIndex = mapFromSource(idx); + QModelIndex rightMostIndex = viewIndex; + QModelIndex tempIndex = viewIndex; while( (tempIndex = rightMostIndex.sibling(rightMostIndex.row(), rightMostIndex.column()+1)).isValid() ) rightMostIndex = tempIndex; - QRect rect = treeView()->visualRect(idx); + QRect rect = treeView()->visualRect(viewIndex); QRect rightMostRect = treeView()->visualRect(rightMostIndex); rect.setLeft( rect.left() + 20 ); @@ -278,9 +303,9 @@ int bottom = rightMostRect.bottom() - 5 ; if( expansion == ExpandDownwards ) - top += basicRowHeight(idx); + top += basicRowHeight(viewIndex); else - bottom -= basicRowHeight(idx); + bottom -= basicRowHeight(viewIndex); rect.setTop( top ); rect.setBottom( bottom ); @@ -290,6 +315,8 @@ bool ExpandingWidgetModel::isExpandable(const QModelIndex& idx_) const { + Q_ASSERT(idx_.model() == this); + QModelIndex idx(firstColumn(idx_)); if( !m_expandState.contains(idx) ) @@ -305,15 +332,19 @@ bool ExpandingWidgetModel::isExpanded(const QModelIndex& idx_) const { + Q_ASSERT(idx_.model() == this); + QModelIndex idx(firstColumn(idx_)); return m_expandState.contains(idx) && m_expandState[idx] == Expanded; } void ExpandingWidgetModel::setExpanded(QModelIndex idx_, bool expanded) { + Q_ASSERT(idx_.model() == this); + QModelIndex idx(firstColumn(idx_)); - //qCDebug( PLUGIN_QUICKOPEN ) << "Setting expand-state of row " << idx.row() << " to " << expanded; + qCDebug( PLUGIN_QUICKOPEN ) << "Setting expand-state of row " << idx.row() << " to " << expanded; if( !idx.isValid() ) return; @@ -345,18 +376,20 @@ } //Eventually partially expand the row - if( !expanded && firstColumn(treeView()->currentIndex()) == idx && (isPartiallyExpanded(idx) == ExpandingWidgetModel::ExpansionType::NotExpanded) ) + if( !expanded && firstColumn(mapToSource(treeView()->currentIndex())) == idx && (isPartiallyExpanded(idx) == ExpandingWidgetModel::ExpansionType::NotExpanded) ) rowSelected(idx); //Partially expand the row. emit dataChanged(idx, idx); if(treeView()) - treeView()->scrollTo(idx); + treeView()->scrollTo(mapFromSource(idx)); } } int ExpandingWidgetModel::basicRowHeight( const QModelIndex& idx_ ) const { + Q_ASSERT(idx_.model() == treeView()->model()); + QModelIndex idx(firstColumn(idx_)); ExpandingDelegate* delegate = dynamic_cast( treeView()->itemDelegate(idx) ); @@ -370,6 +403,8 @@ void ExpandingWidgetModel::placeExpandingWidget(const QModelIndex& idx_) { + Q_ASSERT(idx_.model() == this); + QModelIndex idx(firstColumn(idx_)); QWidget* w = nullptr; @@ -380,16 +415,17 @@ if( !idx.isValid() ) return; - QRect rect = treeView()->visualRect(idx); + const QModelIndex viewIndex = mapFromSource(idx_); + QRect rect = treeView()->visualRect(viewIndex); if( !rect.isValid() || rect.bottom() < 0 || rect.top() >= treeView()->height() ) { //The item is currently not visible w->hide(); return; } - QModelIndex rightMostIndex = idx; - QModelIndex tempIndex = idx; + QModelIndex rightMostIndex = viewIndex; + QModelIndex tempIndex = viewIndex; while( (tempIndex = rightMostIndex.sibling(rightMostIndex.row(), rightMostIndex.column()+1)).isValid() ) rightMostIndex = tempIndex; @@ -400,7 +436,7 @@ rect.setRight( rightMostRect.right() - 5 ); //These offsets must match exactly those used in KateCompletionDeleage::sizeHint() - rect.setTop( rect.top() + basicRowHeight(idx) + 5 ); + rect.setTop( rect.top() + basicRowHeight(viewIndex) + 5 ); rect.setHeight( w->height() ); if( w->parent() != treeView()->viewport() || w->geometry() != rect || !w->isVisible() ) { diff --git a/plugins/quickopen/quickopenmodel.cpp b/plugins/quickopen/quickopenmodel.cpp --- a/plugins/quickopen/quickopenmodel.cpp +++ b/plugins/quickopen/quickopenmodel.cpp @@ -341,7 +341,7 @@ void QuickOpenModel::resetTimer() { - int currentRow = treeView() ? treeView()->currentIndex().row() : -1; + int currentRow = treeView() ? mapToSource(treeView()->currentIndex()).row() : -1; beginResetModel(); //Remove all cached data behind row m_resetBehindRow @@ -354,7 +354,7 @@ endResetModel(); if (currentRow != -1) { - treeView()->setCurrentIndex(index(currentRow, 0, QModelIndex())); //Preserve the current index + treeView()->setCurrentIndex(mapFromSource(index(currentRow, 0, QModelIndex()))); //Preserve the current index } m_resetBehindRow = 0; } @@ -418,7 +418,10 @@ return m_treeView; } -bool QuickOpenModel::indexIsItem(const QModelIndex& /*index*/) const { +bool QuickOpenModel::indexIsItem(const QModelIndex& index) const +{ + Q_ASSERT(index.model() == this); + Q_UNUSED(index); return true; } diff --git a/plugins/quickopen/quickopenplugin.cpp b/plugins/quickopen/quickopenplugin.cpp --- a/plugins/quickopen/quickopenplugin.cpp +++ b/plugins/quickopen/quickopenplugin.cpp @@ -793,6 +793,7 @@ model->registerProvider( QStringList(), QStringList(), new DeclarationListDataProvider(QuickOpenPlugin::self(), items, true) ); dialog = new QuickOpenWidgetDialog( i18n("Outline"), model, QStringList(), QStringList(), true ); + dialog->widget()->setSortingEnabled(true); model->setParent(dialog->widget()); } diff --git a/plugins/quickopen/quickopenwidget.h b/plugins/quickopen/quickopenwidget.h --- a/plugins/quickopen/quickopenwidget.h +++ b/plugins/quickopen/quickopenwidget.h @@ -28,6 +28,7 @@ #include #include #include +#include class QuickOpenModel; @@ -50,6 +51,9 @@ void setAlternativeSearchField(QLineEdit* alterantiveSearchField); + bool sortingEnabled() const; + void setSortingEnabled(bool enabled); + //Shows OK + Cancel. By default they are hidden void showStandardButtons(bool show); void showSearchField(bool show); @@ -79,6 +83,8 @@ void avoidMenuAltFocus(); QuickOpenModel* m_model; + QAbstractProxyModel* m_proxy = nullptr; + bool m_sortingEnabled = false; bool m_expandedTemporary, m_hadNoCommandSinceAlt; QTime m_altDownTime; QString m_preselectedText; diff --git a/plugins/quickopen/quickopenwidget.cpp b/plugins/quickopen/quickopenwidget.cpp --- a/plugins/quickopen/quickopenwidget.cpp +++ b/plugins/quickopen/quickopenwidget.cpp @@ -21,7 +21,6 @@ */ #include "quickopenwidget.h" -#include #include "debug.h" #include "expandingtree/expandingdelegate.h" @@ -31,10 +30,12 @@ #include #include +#include #include #include #include +#include #include using namespace KDevelop; @@ -149,6 +150,16 @@ } } +bool QuickOpenWidget::sortingEnabled() const +{ + return m_sortingEnabled; +} + +void QuickOpenWidget::setSortingEnabled(bool enabled) +{ + m_sortingEnabled = enabled; +} + void QuickOpenWidget::updateTimerInterval(bool cheapFilterChange) { const int MAX_ITEMS = 10000; @@ -195,10 +206,26 @@ void QuickOpenWidget::prepareShow() { - ui.list->setModel( nullptr ); + ui.list->setModel(nullptr); ui.list->setVerticalScrollMode(QAbstractItemView::ScrollPerItem); - m_model->setTreeView( ui.list ); - ui.list->setModel( m_model ); + m_model->setTreeView(ui.list); + + // set up proxy filter + delete m_proxy; + m_proxy = nullptr; + + if (sortingEnabled()) { + auto sortFilterProxyModel = new QSortFilterProxyModel(this); + sortFilterProxyModel->setDynamicSortFilter(true); + m_proxy = sortFilterProxyModel; + } else { + m_proxy = new QIdentityProxyModel(this); + } + m_proxy->setSourceModel(m_model); + if (sortingEnabled()) { + m_proxy->sort(1); + } + ui.list->setModel(m_proxy); m_filterTimer.stop(); m_filter = QString(); @@ -311,22 +338,23 @@ m_model->textChanged( m_filter ); QModelIndex currentIndex = m_model->index(0, 0, QModelIndex()); - ui.list->selectionModel()->setCurrentIndex( currentIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows | QItemSelectionModel::Current ); + + ui.list->selectionModel()->setCurrentIndex( m_proxy->mapFromSource( currentIndex ), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows | QItemSelectionModel::Current ); callRowSelected(); } void QuickOpenWidget::callRowSelected() { - QModelIndex currentIndex = ui.list->selectionModel()->currentIndex(); + const QModelIndex currentIndex = ui.list->currentIndex(); if( currentIndex.isValid() ) - m_model->rowSelected( currentIndex ); + m_model->rowSelected(m_proxy->mapToSource(currentIndex)); else qCDebug(PLUGIN_QUICKOPEN) << "current index is not valid"; } void QuickOpenWidget::accept() { QString filterText = ui.searchLine->text(); - m_model->execute( ui.list->currentIndex(), filterText ); + m_model->execute( m_proxy->mapToSource( ui.list->currentIndex() ), filterText ); } void QuickOpenWidget::doubleClicked ( const QModelIndex & index ) { @@ -354,7 +382,7 @@ if(keyEvent->key() == Qt::Key_Alt) { if((m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) > 300) || (!m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) < 300 && m_hadNoCommandSinceAlt)) { //Unexpand the item - QModelIndex row = ui.list->selectionModel()->currentIndex(); + QModelIndex row = m_proxy->mapToSource(ui.list->selectionModel()->currentIndex()); if( row.isValid() ) { row = row.sibling( row.row(), 0 ); if(m_model->isExpanded( row )) @@ -371,7 +399,7 @@ avoidMenuAltFocus(); m_hadNoCommandSinceAlt = true; //Expand - QModelIndex row = ui.list->selectionModel()->currentIndex(); + QModelIndex row = m_proxy->mapToSource(ui.list->selectionModel()->currentIndex()); if( row.isValid() ) { row = row.sibling( row.row(), 0 ); m_altDownTime = QTime::currentTime(); @@ -403,7 +431,8 @@ case Qt::Key_Up: { if( keyEvent->modifiers() == Qt::AltModifier ) { - QWidget* w = m_model->expandingWidget(ui.list->selectionModel()->currentIndex()); + const QModelIndex index = m_proxy->mapToSource(ui.list->currentIndex()); + QWidget* w = m_model->expandingWidget(index); if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface = dynamic_cast( w ) ){ if( keyEvent->key() == Qt::Key_Down ) @@ -427,14 +456,15 @@ //Expand/unexpand if( keyEvent->modifiers() == Qt::AltModifier ) { //Eventually Send action to the widget - QWidget* w = m_model->expandingWidget(ui.list->selectionModel()->currentIndex()); + const QModelIndex index = m_proxy->mapToSource(ui.list->currentIndex()); + QWidget* w = m_model->expandingWidget(index); if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface = dynamic_cast( w ) ){ interface->previous(); return true; } } else { - QModelIndex row = ui.list->selectionModel()->currentIndex(); + QModelIndex row = m_proxy->mapToSource(ui.list->currentIndex()); if( row.isValid() ) { row = row.sibling( row.row(), 0 ); @@ -450,14 +480,15 @@ //Expand/unexpand if( keyEvent->modifiers() == Qt::AltModifier ) { //Eventually Send action to the widget - QWidget* w = m_model->expandingWidget(ui.list->selectionModel()->currentIndex()); + const QModelIndex index = m_proxy->mapToSource(ui.list->currentIndex()); + QWidget* w = m_model->expandingWidget(index); if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface = dynamic_cast( w ) ){ interface->next(); return true; } } else { - QModelIndex row = ui.list->selectionModel()->currentIndex(); + QModelIndex row = m_proxy->mapToSource(ui.list->selectionModel()->currentIndex()); if( row.isValid() ) { row = row.sibling( row.row(), 0 ); @@ -477,7 +508,8 @@ } if( keyEvent->modifiers() == Qt::AltModifier ) { //Eventually Send action to the widget - QWidget* w = m_model->expandingWidget(ui.list->selectionModel()->currentIndex()); + const QModelIndex index = m_proxy->mapToSource(ui.list->currentIndex()); + QWidget* w = m_model->expandingWidget(index); if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface = dynamic_cast( w ) ){ interface->accept(); @@ -490,7 +522,7 @@ //which kills the quickopen widget. QPointer stillExists(this); - if( m_model->execute( ui.list->currentIndex(), filterText ) ) { + if( m_model->execute( m_proxy->mapToSource( ui.list->currentIndex() ), filterText ) ) { if(!stillExists) return true;