Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Listmodel with Search or filter option In QML?
In that program consists of textfield and below that listview. The data is obtained from the listmodel and displayed in the listview. The selected list data will be appear in the textfield. If I filter the listview based on the text entered in the textfield appear below the textfield. so, I need logic for filter or search in listview based on the entered data in the textfield in QML.
QML supports C++ models.
Thus the most effective way is to subclass QSortFilterProxyModel and register the subclass to QML.
Thank you for your reply. I already go through that. Any other option in QML itself?
no QML is rather limited regarding creating models, and thats good IMHO.
@raven-worx Thanks for your quick reply..
samakkon last edited by
One hack to make this in QML is to set the delegate visibility and height based on a filter i.e. something like:
height: visible ? 20 : 0
where name is the listmodel field you wan't to filter. But as said this is a hack not a proper solution.
@samakkon Oh. Ok...Thanks