From kde-core-devel Wed Aug 23 14:35:52 2006 From: Ingo =?iso-8859-1?q?Kl=F6cker?= Date: Wed, 23 Aug 2006 14:35:52 +0000 To: kde-core-devel Subject: Re: KClearableLineEdit Message-Id: <200608231635.58825 () helena ! mathA ! rwth-aachen ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=115634379112422 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1268690.tAUepCm71H" --nextPart1268690.tAUepCm71H Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Am Mittwoch, 23. August 2006 14:26 schrieb Jaroslaw Staniek: > 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? QComboBox *cb =3D new QComboBox(); KClearableLineEdit *cle =3D new KClearableLineEdit( cb ); cb.setLineEdit( cle ); (or something similar) should work in the case of the combo box. > Maybe we can _also_ have an interface that can be=20 > inherited, thus delivering the "clearing" functionality? KClearableLineEdit has exactly the same interface as KLineEdit. It=20 doesn't add any new methods. What you probably mean is usage of the=20 Decorator pattern instead of introducing a new subclass (KCLE) forcing=20 everybody to change the class they derive from=20 (s/KLineEdit/KClearableLineEdit/) in order to get the functionality of=20 the new subclass. Regards, Ingo --nextPart1268690.tAUepCm71H Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBE7GfOqUQWN/hplRsRAjUsAKCmSMD9TcGkNMUEqbtc5Z5xrdjEjACeKTQ0 hTTybUOIfMPoCcIFzYMj2hY= =Qx37 -----END PGP SIGNATURE----- --nextPart1268690.tAUepCm71H--