PDA

View Full Version : how to filer a QAbstractTableModel model



learningqt
7th March 2012, 12:52
I have created a QAbstractTableModel tableModel and QAbstractListModel listModel and set these model to respective views (QTableView and QListView).I want to filter the tableModel based on the listModel.That mean when someone clicks on a list item and the tableview should be fliter based on the list item.The model are working perfectly.Please help

high_flyer
8th March 2012, 10:47
Have a look at QSortFilterProxyModel

learningqt
9th March 2012, 09:54
Do you have any example on how i can use it...I was reading on QAbstractProxyModel...any sample code...thankz

high_flyer
9th March 2012, 11:07
.I was reading on QAbstractProxyModel
if you did how come you missed this:
http://qt-project.org/doc/qt-4.8/itemviews-customsortfiltermodel.html

learningqt
9th March 2012, 12:09
I am actually trying that out...:P