Review Request 101486 (Q/KComboBox related KConfigDialogManager change) breaks apps
Andreas Pakulat
apaku at gmx.de
Wed Nov 30 22:33:55 GMT 2011
On 30.11.11 22:06:12, Christoph Feck wrote:
> On Wednesday 30 November 2011 21:50:41 Andreas Pakulat wrote:
> > Since nonetheless there's the case of breaking existing apps with
> > this change, I'd like to check other peoples opinions on adding
> > some more logic to the kconfigdialogmanager's code so that if the
> > user-property comes from a pure Q/KCombobox (i.e. not a subclass)
> > and is currentIndex its ignored, otherwise its taken account.
>
> I did not yet find a way to see if the user property actually comes
> from QComboBox, or a subclass. I guess the Qt property system has no
> way to find that out, but if you find a way, please share a patch.
That should be doable:
int qcombouserpropindex = QComboBox::staticMetaObject.indexOfProperty(QComboBox::staticMetaObject.userProperty().name());
int curwidgetuserpropindex = widget->metaObject()->indexOfProperty(widget->metaObject()->userProperty().name());
if( qcombouserpropindex != -1 && curwidgetuserpropindex != -1 &&
qcombouserpropindex != curwidgetuserpropindex ) {
// user user-property
} else {
// use the q/kcombobox special code
}
Or am I overlooking something? Obviously that would need a really
verbose comment on why its done :)
Andreas
More information about the kde-core-devel
mailing list