Filter in QListView
Unsolved
General and Desktop
-
I do the query and show that in QListView.
QSqlQueryModel * model = new QSqlQueryModel(0); model->setQuery("select ......");
How to make a filter? When I will write smth in QLineEdit, the QListView will refresh with that filter? If I'll make QLineEdit clear, the QListView will show model, that shows basically.
-
Hi
You can use a extra model for that
http://doc.qt.io/qt-5/qsortfilterproxymodel.html#details -
@derilshows said:
Hi , what you mean with widget?
you use it with your QSqlQueryModel.there is sample on how to use it
http://doc.qt.io/qt-5/qtwidgets-itemviews-basicsortfiltermodel-example.html