Bug 44340

Summary: no completion available on KComboBox after setEditable(true)
Product: [Frameworks and Libraries] kdelibs Reporter: ismore
Component: qtAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: grundleborg
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description ismore 2002-06-25 18:55:17 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kdelibs
Version:           KDE 3.0.5 CVS/CVSup/Snapshot
Severity:          normal
Installed from:    Compiled sources
Compiler:          gcc 2.96
OS:                Linux
OS/Compiler notes: Not Specified

If I create a readonly KComboBox and afterwards call setEditable(true) (like what QDesigner does) it doesn't get completion.

From what it seems the problem is that QComboBox::setEditable calls setLineEdit with a "new QLineEdit" as argument not a KLineEdit. So the dynamic cast in KComboBox::setLineEdit fails and the signals doesn't get connected. 

I don't know if there is a easy fix for it but at least it should be documented.

(Submitted via bugs.kde.org)
Comment 1 John Firebaugh 2002-06-29 19:37:10 UTC
> If I create a readonly KComboBox and afterwards call setEditable(true)
> (like what QDesigner does) it doesn't get completion. 
>
> From what it seems the problem is that QComboBox::setEditable calls
> setLineEdit with a "new QLineEdit" as argument not a KLineEdit. So the
> dynamic cast in KComboBox::setLineEdit fails and the signals doesn't get
> connected. 
>
> I don't know if there is a easy fix for it but at least it should be
> documented.
 
Wow. How annoying. This is definitely a flaw in Qt as neither 
QComboBox::setEditable() and QComboBox::setUpLineEdit() are virtual. 
Basically there is no way to maintain control over the line edit when 
changing editability.

-John
Comment 2 George Goldberg 2007-12-18 05:22:20 UTC
Is this bug still present in a recent version of KDE, such as 3.5.8 or KDE 4 RC2?
Comment 3 George Goldberg 2008-02-15 04:24:59 UTC
Closing due to no response. Please reopen if this bug can be reproduced with KDE >= 4.0.1