[Qt-interest] QAbstractProxyModel methods index, parent, rowCount, columnCount not implemented?
Ross Bencina
rossb-lists at audiomulch.com
Wed May 18 05:10:54 CEST 2011
Hi
I'm trying to implement a QAbstractProxyModel subclass. I get a linker error
that suggests that index, parent, rowCount and columnCount are pure virtual
and havn't been implemented by QAbstractProxyModel. This contradicts the
documentation, which indicates that I only need to implement the map*
functions. I'm using Qt4.6.7 but the 4.7 documentation is the same:
http://doc.qt.nokia.com/latest/qabstractproxymodel.html
Is this a known bug?
Note that when I provide an implementation of these methods then
sourceModel() appears to return NULL if it hasn't been expicitly set. This
appears to violate the following guarantee in the documentation, since
sourceModel() aooears to be returning NULL, not the empty placeholder model:
> Note: If the source model is deleted or no source model is specified,
> the proxy model operates on a empty placeholder model.
I'm not subclassing QSortFilterProxy because my proxy doesn't change the
item layout. I just need to decorate some items by changing flags and
secondary data based on item values.
Thanks
Ross.
More information about the Qt-interest-old
mailing list