[Interest] Why are QAbstractProxyModel::mapToSource and mapFromSource public?
phil.kursawe at gmail.com
Wed Dec 11 17:36:36 CET 2013
When you have complex chain of ProxyModels you cannot use the result index
from a call to mapToSource because you cannot know how many proxy models
are down the chain.
Imagine this chain:
p2 -> p1 -> m0
pX are Proxy models, m0 is the base model.
I know only about p2 in my part of the code and want to know which index
that is in the m0 model.
So I would have to call p2->mapToSource, then p1->mapToSource and finally
have the index of m0.
In code that would be a loop over pX->sourceModel while the sourceModel is
I understand the proper way to access data in the m0 model is to use the
data() method, which would internally correctly map the indicies.
I just wonder why the index mapping was made public API in the first place?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest