Bug 293702

Summary: KConfigDialogManager fails to handle subclasses of QComboBox with custom property
Product: [Unmaintained] kdelibs Reporter: Christoph Feck <cfeck>
Component: kdeuiAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aacid
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christoph Feck 2012-02-09 10:48:41 UTC
To quote myself:

I think I see what's going wrong. We decided to ignore the user 
property for QComboBox once Qt added it, because it was different from 
what KDE expected (KDE needs the text, Qt uses the index).

We should continue to ignore this user property from QComboBox and all 
its subclasses, unless the subclass has its own user property, like 
KColorCombo does.

I have to check if Qt's meta system can supply this information...


Andreas Pakulat wrote:

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 :)
Comment 1 Christoph Feck 2012-02-09 10:50:08 UTC
For more information, see "Bug in kcfg, KColorCombo not handled correct" on k-c-d, and "Review Request 101486" on k-c-d.
Comment 2 Albert Astals Cid 2012-02-09 23:26:23 UTC
There's a fix for this at https://git.reviewboard.kde.org/r/103909/
Comment 3 Albert Astals Cid 2012-02-23 22:13:46 UTC
Git commit c27b939ac971f23e8cf8950e76c3f2745c634d72 by Albert Astals Cid.
Committed on 23/02/2012 at 23:12.
Pushed by aacid into branch 'KDE/4.8'.

Fix KConfigDialogManager fails to handle subclasses of QComboBox with custom property
REVIEW: 103909
Acked by Christoph Feck

M  +18   -6    kdeui/dialogs/kconfigdialogmanager.cpp
M  +1    -0    kdeui/tests/CMakeLists.txt
A  +132  -0    kdeui/tests/kconfigdialog_unittest.cpp     [License: LGPL (v2+)]

http://commits.kde.org/kdelibs/c27b939ac971f23e8cf8950e76c3f2745c634d72