How to use virtualkeyboard in popup
-
I made a colordialog popup. I want the user can select the color by RGB or HSV. There are one circle and two slider for HSV. A textfield for RGB. When the textfield get focused, the virtualkeyboard displayed. but the virtualkeybord is Main.qml's child. in this case. the virtualkeyboard is masked(as the pics). How do I use the virtualkeyboard in popup?

-
Do you instantiate the InputPanel yourself?
-
Old post, still same problem here unfortunately. In my case using InputPanel explicitly. InputPanel is not a child of the Popup, but if I understand right it is a Singleton anyway. Any ideas?
@felix_u said in How to use virtualkeyboard in popup:
In my case using InputPanel explicitly. InputPanel is not a child of the Popup, but if I understand right it is a Singleton anyway. Any ideas?
There are no Singletons involved.
Popups are children of an "overlay item" (see https://doc.qt.io/qt-6/qml-qtquick-controls-overlay.html) which has a very high z-value. So, you must:
- Make your keyboard a sibling of that overlay item, AND
- Give your keyboard a higher z-value than that overlay item
Try this:
InputPanel { parent: Overlay.overlay.parent // Make the keyboard a sibling of the overlay z: Overlay.overlay.z + 1 // Give the keyboard a higher z-value than the overlay // ... } -
Hi Guys,
thanks for replying - I need to enable my email notifications... Also sorry for not being able to provide example code. I am explicitly instancing the InputPanel myself - and not so long ago learned that really only one instance is needed. Still it is a matter of where placing the instance inside the QML hierarchy as Overlays are special, because they are not part of the hierarchical structure.parent: Overlay.overlaydid not work in the first place. I am not exactly sure what finally did the trick but it might have been placing the InputPanel as a direct child to the Window (and thus making it a sibling - not a child - to contentItem). Works now.
Thanks so much
Felix