I have a QSortFilterProxyModel as a QTreeView's model (qtbug73864.zip). I use search functionality for the view and use match() function to get indexes that matches search results.
If I set the index from match() results as a current index in view's model, the index is not highlighted.
If I map the index to an index from sourceModel (mapToSource) and then use that index to map to an index in proxyModel (mapFromSource, because proxyModel is used as view's model) and use that to select current item, it works.
Note: It works when typing a search text from the top row or from the first column ("Containers", "General")
Please find the attached example app to demonstrate this behavior. The match functionality is implemented in MainWindow::_mSlotSearchText()
Run the app and write 'QFrame' in the search field. TreeItem is collapsed but the correct row is not highlighted
Note: It works when entering a search text from the top row or first column ("widgets", "General").
For reference, qtbug73864_stditm.zip is an implementation based on QStandardItemModel (which again acts differently).