[Interest] TextField QML auto keyboard hiding/lose focus on touch events

Gian Maxera gmaxera at gmail.com
Mon Jan 25 18:20:20 CET 2016


Hello Mark,
I achieve that on mobile using a simple MouseArea that cover all the screen and it’s under all other active elements.
When that MouseArea is touched, I call Qt.inputMethod.hide() … and that’s it.
So, if the user touch outside any button, textfield, etc… then that touch will reach the underlying MouseArea that will call the hide on keyboard.

Ciao,
Gianluca.


> On 25 Jan 2016, at 17:16, mark diener <rpzrpzrpz at gmail.com> wrote:
> 
> Hello List:
> 
> Anybody have a tip or suggestion for IOS/Android Qt 5.5.1 -> Qt 5.6.0 Beta
> 
> I am using a TextField and the keyboard pops up whenever the input control
> receives focus.
> 
> But I want the TextField to lose focus whenever you click/touch
> outside of the control.
> 
> Not Just Tab & Enter that are VERY PC centric, not tablet/smartphone concepts.
> 
> Right now, the blinking cursor remains on the field and the
> Android/IOS keyboard remains visible
> when you use your finger and touch some where outside of the TextField.
> 
> Obviously, I want the keyboard to REMAIN if the user clicks on ANOTHER
> TextField.
> 
> Is there a QML way to do this?
> 
> I have some C++ and event filter ideas to make this happen, but those
> are brute force ideas and there might be something that I don't see in
> the QML TextField documentation.
> 
> Thanks,
> 
> md
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list