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

List:       kde-devel
Subject:    Re: QLineEdit, selectAll() and focusInEvent question
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2004-10-03 16:33:32
Message-ID: 200410031833.32911.kevin.krammer () gmx ! at
[Download RAW message or body]

On Saturday 02 October 2004 23:41, RKirsch812@aol.com wrote:

> My big problem is, that point 2 not works. If I test my solution, by
> clicking into my "MyQLineEdit" widget in order to get it focussed,
> I see that it is selected as if I would select it by pressing
> the TAB-key, but a piece of a second later my selection is gone (and
> only the text and the cursor are displayed in my widget).

If the click gets to the widget after the focusInEvent, it will be lik 
clicking on an already selected text, therefore unselecting it as a whole and 
placing the caret.

You could try this (but there might be a better way of course):
in focusInEvent, don't call selectAll() directly, but use a QTimer::singleShot 
to call it delayed (timeout 0, after all currently queued events have been 
processed)

Cheers,
Kevin

-- 
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
www.mrunix.de - German Unix/Linux programming forum
www.qtforum.org - Qt programming forum
 
>> 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