KClearableLineEdit

Jaroslaw Staniek js at iidea.pl
Wed Aug 23 13:26:00 BST 2006


Aaron J. Seigo said the following, On 2006-08-23 09:27:

> attached is a class that implements a line edit with an embedded clear button. 
> the intention is to replace all those lineedits with the clear button next to 
> them. why?
> 
> a) they currently look ugly by breaking layouts out
> b) they unnecessarily increase the visual noise with More Buttons
> c) being external to the line edit they are currently not very well associated 
> with the widget they act upon.
> 
> the only downside to this new class (besides bugs i am not aware of and some 
> unwanted flickering on resizing, all of which are fixables as issues arise) 
> is that i'm not sure what the accessibility impact would be; worst case is 
> that this class would need to export via QAccessible that it has a clear 
> function? not sure ... 
> 
> i also implemented this as a subclass of KLineEdit rather than embed the 
> functionality into KLineEdit since KLineEdit is already a pretty hairy beast 
> and i didn't want to add to that.

Nice improvement. One note: what if I have already reimplemented KLineEdit (or 
  want to add the 'clear' button to aneditable combo box or date/time edit? 
Maybe we can _also_ have an interface that can be inherited, thus delivering 
the "clearing" functionality?

Example use:

class KClearableLineEdit : public KLineEdit, KClearableInterface

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi-project.org, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org




More information about the kde-core-devel mailing list