alex9099
3rd October 2008, 12:36
Good day, using qt4.3
1. My configuration:
MyModel (from QAbstractItemModel)
MySortFilter (from QSortFilterProxyModel)
MyView (from QTreeView)
2. MyModel is using external data source, which is a list of items, each item has its own label, so when label is changed in external source I would like to update it in the MyView and automatically re-sort elements. At the moment, I'm emitting dataChange signal for changed indexes and MyView successfully updates these indexes. The problem is that items are not re-sorted.
3. Note, that on initial model load strings are sorted correctly and after emitting dataChange signal I can see that MySortFilter's lessThan and filterAcceptsRow are called. Moreover, I can see that layoutChange signal is received by MyView.
4. MySortFilter is using dynamic filter, enabled with setDynamicSortFilter(true)
Any suggestions?
Thanks!
1. My configuration:
MyModel (from QAbstractItemModel)
MySortFilter (from QSortFilterProxyModel)
MyView (from QTreeView)
2. MyModel is using external data source, which is a list of items, each item has its own label, so when label is changed in external source I would like to update it in the MyView and automatically re-sort elements. At the moment, I'm emitting dataChange signal for changed indexes and MyView successfully updates these indexes. The problem is that items are not re-sorted.
3. Note, that on initial model load strings are sorted correctly and after emitting dataChange signal I can see that MySortFilter's lessThan and filterAcceptsRow are called. Moreover, I can see that layoutChange signal is received by MyView.
4. MySortFilter is using dynamic filter, enabled with setDynamicSortFilter(true)
Any suggestions?
Thanks!