[Qt-interest] Subclassing selection model

Andreas Pakulat apaku at gmx.de
Thu Feb 18 16:33:31 CET 2010


Hi,

I've got a problem here subclassing QItemSelectionModel. The reason to
do this, is because I'm having a proxy model between view and model.
Unfortunately the parts using the model and also the selection-model
don't know anything about the proxy (and can't know). So I thought I'd
also add a proxy-selection-model between the selectionmodel and the
view.

Unfortunately it seems this doesn't work, so far all I did was
connecting to the selectionmodel-signal and converting their indexes
using the proxymodel and overriding the virtual functions in
QItemSelectionModel to forward to the source-selection-model with also
converted indexes.

Unfortunately this leads to strange invalid lines in the itemview (not
the source model), when the source model is populated dynamically
(instead of adding a complete subtree into it).

Is anybody here aware of possible problems when trying to write a
proxy-selection-model class?

Andreas

-- 
You will be honored for contributing your time and skill to a worthy cause.



More information about the Qt-interest-old mailing list