Hello
I use a custom ProxyModel that inherits from QSortFilterProxyModel and overwrites the following methods of QSortFilterProxyModel.
|
Source code
|
1
2
3
|
protected:
virtual bool lessThan ( const QModelIndex & left, const QModelIndex & right ) const;
virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const;
|
The constructor looks like
|
Source code
|
1
2
|
MySortFilterProxyModel::MySortFilterProxyModel()
: QSortFilterProxyModel() {}
|
Everything works pretty well, except that my ProxyModel resorts and calls filterAcceptsRow when the source model emits the dataChanged even if dynamicSortFilter is set to false.
A look at the QSortFilterProxyModel.cpp under
http://www.koders.com/cpp/fidB9A2451A0F6…e+mdef%3Ainsert
did not help me to solve the problem.
As far as I can see Trolltec's example implementation at
http://doc.trolltech.com/4.3/itemviews-c…oxymodel-h.html
does not use any tricks to inherit from QSortFilterProxyModel.
I use Qt 4.3, the QSortFilterProxyModel documentation can be found under
http://doc.trolltech.com/4.3/qsortfilterproxymodel.html
I'm grateful for any help,
norbnorb