[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Clearing a QLineEdit
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () gmail ! com>
Date:       2011-06-20 20:52:39
Message-ID: 201106202252.39838.thomas.luebking () gmail ! com
[Download RAW message or body]

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 <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic