Hi Johan, Please reply to the list.
On Monday, January 16, 2012 08:22:48 you wrote: > 2012/1/16 Stephen Kelly <stephen.ke...@kdab.com>: > > I'm not sure what your actual proposal is? > > My issue is that the role names of a proxy model are taken directly > from the model being proxied, i.e. the following lines from > qabstractproxymodel.cpp (around line 135, in > QAbstractProxyModel::setSourceModel, Qt 4.8): > > ... > } > d->roleNames = d->model->roleNames(); > } > ... > > This overrides any attempts to use setRoleNames in a proxymodel, to > do, for instance, role-name.transformations. How so? This works: MyProxyModel::setSourceModel(...) { // ... BaseProxy::setSourceModel(...); // ... setRoleNames(...); } > My impression is that this did not work correctly with 4.8, but all I > really confirmed was that I got questions for the wrong role numbers. > The core reason for this, is that Qt 4.8 forces the wrong role names > onto the proxy models. How does it force the wrong role names onto proxy models? > A virtual method looks handy, makes it possible to do what I want to. > However, the default role name setting in > QAbstractProxyModel::setSourceModel is still present in Qt 5.0. > > Does it make more sense now? :-) I'm afraid I don't see why the above setSourceModel implementation wouldn't work. Thanks, -- Stephen Kelly <stephen.ke...@kdab.com> | Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-Independent Software Solutions
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development