Version: 4.2.3 (using KDE 4.2.3) OS: Linux Installed from: SuSE RPMs The clear button isn't show properly with this code: KLineEdit* textBox = new KLineEdit( i18n("Some text"), parent ); textBox->setClearButtonShown(true); But it is shown properly with this code: KLineEdit* textBox = new KLineEdit( parent ); textBox->setClearButtonShown(true); textBox->setText( i18n("Some text") );
Here using: Qt: 4.5.1 (qt-copy 971295) KDE: 4.2.91 (KDE 4.2.91 (KDE 4.3 >= 20090609)) kdelibs svn rev. 982117 / kdebase svn rev. 982118 on ArchLinux i686 - Kernel 2.6.29.4 I can confirm this bug
SVN commit 982488 by darioandres: -- When a KLineEdit is initialized with no text in the constructor, the KLineEditButton::animateVisible function is first called with false (animate to invisible), and the direction is set to Backward When a text is set by code or by typing, animateVisible is called with true and the button is properly shown. However, when text is set on constructor of KLineEdit, the first animateVisible call with false will not be done, but the one with true will do. And it will return without showing the clear button because: m_timeline->direction() == QTimeLine::Forward (as set by constructor) -- Initialize KLineEditButton::m_timeLine as Backward will fix this issue, avoiding the need of the animateVisible(false) call for this widget to work. However, the button should have a better state of "I'm visible" to avoid calling to "animate to invisible" at first time, when the button isn't even shown. BUG: 193045 M +1 -1 klineedit_p.h WebSVN link: http://websvn.kde.org/?view=rev&revision=982488
thank you very much
Unfortunately, it looks like the bug is back: bug 268898.