[Android-development] QLineEdit and virtual keyboard

maitai at virtual-winds.org maitai at virtual-winds.org
Sun Aug 3 20:06:06 CEST 2014


Thanks Eskil, 

I have just a few QLineEdit in my application, but unfortunately also a
lot of QSpinBoxes where the problem is the same. It's not reasonable to
filter events for all and subclassing them all is quite a pain too. 

I have opened QTBUG-40654 for that. 

Btw I am wondering if I should open another two for these other
problems, also related to virtual keyboard: 

When using the virtual keyboard for a QSpinBox or a QDoubleSpinBox one
would expect to get a numerical keyboard. That would indeed be much
easier for the user. This is related to QTBUG-37619 for QtQuick so I
don't know if I should open another one specificaly for QWidgets. 

When modifying a QSpinBox or QDoubleSpinBox, it's possible to modify the
suffix and prefix also, and the cursor is on the last character of the
suffix which is not good too. 

Thanks for your input 

Philippe Lelong 

Le 31-07-2014 08:45, Eskil Abrahamsen Blomfeldt a écrit : 

> On 07/24/2014 12:03 PM, maitai at virtual-winds.org wrote: 
>> Ok then, but this is weird to me. As a user I do not expect the virtual keyboard's OK button to close the dialog, but just to close the virtual keyboard so I can continue with other fields. 
>> I have tried to setDefault(false) all the buttons in the dialog but it still calls done(), so it seems I cannot modify this behavior. 
>> Note that pressing the physical "ok" button on the device just close the virtual keyboard and not the dialog. 
>> Well... It seems I have to get used to it ;)
> This is indeed a bit strange. What's happening here is that the virtual keyboard's OK button is generating a key event for the Enter key which is sent to the QLineEdit, but since QLineEdit ignores this key, it is sent to the QDialog instead. QDialog handles key events and will accept its button box when it sees an Enter key. In the case of a virtual keyboard, which works on a particular line edit, this is unexpected, so I wouldn't mind it if you reported this as a bug, since it should really be part of the platform theme (on Windows, enter should accept the dialog, whereas on Android this does not make sense). 
> As a work-around, you can add an event filter to the QLineEdit and filter out the Enter key presses by returning true whenever you see them.
> -- Eskil
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development [1]


[1] http://lists.qt-project.org/mailman/listinfo/android-development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20140803/9d25fa5c/attachment.html>

More information about the Android-development mailing list