I have one class which is inherited from QAbstractListModel which i am using as my model .. and i am creating list view from this model,, its working fine.
But when i apply QSortFilterProxyModel to it as suggested in below link .:
I am not able to filter it but when i use QStringListModel it gives me the result.. so is this a bug that QSortFilterProxyModel does not work with custom created QAbstractListModel .. plz has anyone done this before and can any one guid me on this..
Below is the code:
lstModel = new ListModel(new FruitItem, this);
for(int i=0; i<=7;i++)
lstModel->appendRow(new FruitItem("Apple", i, lstModel));
lstModel->appendRow(new FruitItem("PineApple", i, lstModel));
lstModel->appendRow(new FruitItem("Grape", i, lstModel));
// QStringList data;
// data << "Alex" << "Bob" << "Celeste" << "David"
// << "Emil" << "Frederik" << "Gerd" << "Harald" << "Ivan";
// m_model = new QStringListModel(this);
m_filter = new QSortFilterProxyModel(this);