[Qt-interest] QAbstractProxyModel methods index, parent, rowCount, columnCount not implemented?
Stephen Kelly
steveire at gmail.com
Wed May 18 11:59:16 CEST 2011
Andre Somers wrote:
> Op Wo, 18 mei, 2011 9:28 am, schreef Ross Bencina:
>> Andre Somers wrote:
>>> I would like to advise you that you _do_ subclass QSortFilterProxyModel
>>> instead. It is much easier to work with, even if you don't want sorting
>>> or filtering. There are no methods to reimplement that are only
>>> concerned with book keeping.
>>
>> Yeah.. digging deeper I realise that QAbstractProxyModel doesn't even
>> bridge
>> the signals from the sourceModel through to to outside.. so it makes more
>> problems than it solves.
>>
>>> Some examples of what you want to do:
>>>
http://developer.qt.nokia.com/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox
>>> http://developer.qt.nokia.com/forums/viewthread/4788
>>
>> Thank you, that's really good to know.
>>
>> It would still be nice if there was a basic QAbstractDecoratorProxyModel
>> base class that didn't have all the overhead of the
>> QSortFilterProxyModel.
> Not a bad idea, actually. A proxy model that is geared towards giving a
> 1:1 representation of the underlying data structure, but that allows you
> to just decorate...
> I am not sure if it makes much of a difference though. Is the overhead of
> QSFPM so big?
>
> André
It's called QIdentityProxyModel and it's in Qt 4.8.
http://doc.trolltech.com/4.8-snapshot/qidentityproxymodel.html
http://steveire.wordpress.com/2010/08/25/kidentityproxymodel-does-nothing-
fast/
More information about the Qt-interest-old
mailing list