[Qt-interest] Proxy model with more indexes than its source model
Jugdish
jugdizh at gmail.com
Mon Feb 8 18:46:24 CET 2010
Is it possible to have a proxy model that has more indexes than its
underlying source model?
I'd like to have a proxy model that inserts additional "header" rows which
act as separators between blocks of rows from the source model. The proxy
model would know which rows indexes correspond to the header rows, and it
would offset the source model rows to make room for the additional rows.
The problem I'm facing is that QAbstractProxyModel really only gives access
to mapToSource() and mapFromSource(), which assume that there is a source
model index corresponding to every proxy model index. But since the header
rows only exist in the proxy model, I need to somehow deal with that
scenario. My first hunch was to re-implement QAbstractProxyModel::data(),
but unfortunately it is not declared as virtual.
Any ideas?
Thanks,
-Jugdish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100208/8cb21fff/attachment.html
More information about the Qt-interest-old
mailing list