Examples: Fix minor bug in Tree Model Completer Example

Minor bug that caused highlighter to not work properly.

Task-number: QTBUG-66084
Change-Id: I7860d7a13c402e3236f4c844020e35e11f6e53e5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Paul Wicking 2018-07-20 06:52:31 +02:00
parent 059b10f295
commit 7f0cc35d9c

View File

@ -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]