diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp index 4aabb040235..a8b51c7aa09 100644 --- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp +++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp @@ -232,7 +232,7 @@ void MainWindow::highlight(const QModelIndex &index) return; QModelIndex sourceIndex = proxy->mapToSource(index); treeView->selectionModel()->select(sourceIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); - treeView->scrollTo(index); + treeView->scrollTo(sourceIndex); } //! [6]