[Qt-interest] QLineEdit loosing its selection

Martin Hofius Martin at hofius-online.com
Mon Aug 3 12:00:39 CEST 2009


Am Montag, 3. August 2009 schrieben Sie:
> Martin Hofius schrieb:
> > why don't you create the popup as a sibling to your line edit? This way
> > you can activate the line edit each time after you click in your virtual
> > keyboard... and you don't have to treat each keypress yourself ;-)
>
> Well, the thing is that as soon as (any) other widget is clicked, the
> selection is removed.
> So, at the moment the widget gets a mouse down event and I could react,
> the selection *is already gone*.
> The mechanism is built deep into Qt and I don't know how to disable it.
so one possible way is to react on the 
void QLineEdit::selectionChanged ()   [signal]
and to maintain the selection yourself. 

Greetings
Martin

> Regards,
> Oliver





More information about the Qt-interest-old mailing list