[Qt-qml] QSortFilterProxyModel: sorting becomes broken when adding list item and filtering is enabled

Stephen Kelly steveire at gmail.com
Mon Feb 7 21:02:57 CET 2011


Michael Nosov wrote:

> Hello, everyone,
> Test 1 (INCORRECT behavior):
> ==================
> - Run 'abstractitemmodel'. You'll see list with 'Animal1, Animal4,
> Animal8' - Enter 'q' in filter text input. You'll see the empty list
> - Now click on 'Add animal' button.
> - Clear text input by clicking 'Clear...' button.
> - You'll see INcorrectly sorted list (Animal1, Animal8, Animal4, Animal7)
> - this list is totally not sorted
> 
> I'm having Qt 4:4.7.0-0ubuntu4.2 on my desktop, but it seems that the bug
> is also applicable for other qt versions (4.7.1, etc.)

I don't know if you figured this out but it's a bug in 
QSortFilterProxyModel.

> 
> Can you please provide your feedback regarding this issue? Maybe suggest
> some workaround for this?

You could try some funky resetting, but it gets ugly.

Thanks,

Steve.

> 
> Thanks a lot in advance,
> Michael




More information about the Qt-qml mailing list