[Qt-interest] QAbstractProxyModel methods index, parent, rowCount, columnCount not implemented?
Bo Thorsen
bo at fioniasoftware.dk
Wed May 18 13:48:54 CEST 2011
Den 18-05-2011 12:09, Andre Somers skrev:
> Op Wo, 18 mei, 2011 11:59 am, schreef Stephen Kelly:
>
>>>> 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/
>>
> Great, I will port my CheckableProxyModel to use it as soon as Qt 4.8 is out.
Nice timing. I was about to write my own class doing pretty much this.
Also for decorations, where the icons are downloaded from the net.
Perfect case for this class.
Yes, I could store it directly in the model, but it doesn't belong there
for this model, and the code was a bit annoying. And delegates don't
really offer per-row storage. This proxy class is exactly what's needed.
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
More information about the Qt-interest-old
mailing list