How to display the search result on QListView?
-
Hi,
AFAIK you can use "QSortFilterProxyModel":http://doc.qt.io/qt-5/qsortfilterproxymodel.html for this. Create a model based on QAbstractListModel and the use "setSourceModel":http://doc.qt.io/qt-5/qsortfilterproxymodel.html#setSourceModel to set this model as source to QSortFilterProxyModel. To filter out the items you can re-implement "filterAcceptsRow":http://doc.qt.io/qt-5/qsortfilterproxymodel.html#filterAcceptsRow and return true or false per the search criteria.