[Qt-qml] QSortFilterProxyModel and QML ListView
Stephen Kelly
steveire at gmail.com
Wed Jan 5 14:04:22 CET 2011
> On Wed, Jan 5, 2011 at 12:31 AM, Bartosh Wroblevksy
> <bartosh at live.com>wrote:
>
>> just curious when rows are moved in a proxy model that is sorted, what
>> sort of an emit do you guys do to signal to the qml window that the model
>> needs to be updated. Do you guys do a full reset?
>>
If rows are moved in the source, the proxy handles that itself. The proxy
will do a layoutChange, which is similar to a full reset. QML treats a
layoutChange as a full reset.
>>Chris wrote:
> I don't think you need to do a full reset.
>
> QSortFilter model has a rowsMoved() signal. There is also a
> layoutChanged() signal whenever the layout changes (e.g. due to sorting).
>
Right. But QSortFilterProxyModel never emits rowsMoved, even if you use it
in your source model. QSortFilterProxyModel treats that as a layoutChange.
All the best,
Steve.
More information about the Qt-qml
mailing list