[Qt-interest] QLineEdit loosing its selection

Martin Hofius Martin at hofius-online.com
Mon Aug 3 11:29:53 CEST 2009


Hi Oliver,

Am Montag, 3. August 2009 schrieb Oliver Demetz:
> Hi all!
>
> If I enter text in my QLineEdit, and make a selection in this text, and
> if I then click somewhere else in my app, the selection is removed
> automatically.
>
> This is the usual and standard behaviour.
>
> Ok.
>
> BUT:
>
> As a child of my QLineEdit, I am opening a widget (window flag
> Qt::Popup) that has virtual keyboard functionality.
> If I click a button inside this child widget, I would like circumvent
> that the selection is removed before this.
>
> Actually, another thing I dont like is that the text cursur disappears
> as soon as the virtual keyboard pops up.
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 ;-)

Greetings
Martin



More information about the Qt-interest-old mailing list