Am Monday 20 June 2011 schrieb Steven Sroka:
> Does anyone know how to clear the contents of a QLineEdit when a user
> sets focus to it (ie. clicks it, presses the tab key repeatedly,
> etc.)?

You don't have to subclass it, just connect some slot to
void QApplication::focusChanged ( QWidget * old, QWidget * now )
Check if "new" is you lineedit and do whatever you must.

I however agree that clearing is likely a bad idea (assume you just wanted to 
fix a one char typo) - you might want to selectAll() instead?


Cheers,
Thomas
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to