QT Virtual Keyboard (InputPanel QML Type) Activation from Just One Qt Quick Text Component
The QT Virtual Keyboard or (InputPanel QML Type) is very powerful.
I have managed to get this InputPanel to pop up all the time, that is, when ANY Text Qt Quick component gains focus and hides when lost focus. That works well.
What I need is to only pop this InputPanel up when the user sets focus to one or two specific Text components, and not globally throughout the application.
- First, is this possible?
- And if so, is there an example that shows how to do this, or some simple instructions on how to do it?
Any guidance would be appreciated here.
Is it possible? Any examples out there to help binding the InputPanel to only one or 2 QtQuick Text components all defined in QML?
I worked around this issue by doing the following:
- Added the InputPanel to my own custom dialog (File Save) to the bottom of it.
- When showing the dialog, I center the dialog on screen, making the InputPanel visible at the bottom of the dialog.
- After the user inputs the file name to save to and clicks "Save", the dialog is made invisible.
- In the dialog's "onVisibleChanged" signal handler, I set dialog.y = 5000, making the dialog move way offscreen even though it is invisible. Now any other component click events are not interfered with.
Works pretty well.