Qt World Summit: Register Today!

Qt5.4.1 Virtual Keyboard not working

  • I'm trying to use the Virtual Keyboard from enterprise addons in a QML app but am having trouble making it work. I added the QT_IM_MODULE=qtvirtualkeyboard env variable and an InputPanel as shown in the example included with the module. Focusing on a TextInput does not bring up the keyboard. Qt.inputMethod.show()/hide() do not seem to affect the visibility of the keyboard; Qt.inputMethod.isVisible is always false. Forcing the InputPanel visible and clicking on keys results in the following console output "DeclarativeInputContext::::sendKeyClick(): <keyCode> no focus".

    Any suggestions? I'm out of ideas at this point.

  • Focusing on a TextInput does not bring up the keyboard if the project "kit" is for the "Desktop".

    Does the issue happen if you run on a simulator or actual device?

    In the QApplication Class there is something called: "autoSipEnabled : bool"
    This property holds toggles automatic SIP (software input panel) visibility.

    Set this property to true to automatically display the SIP when entering widgets that accept keyboard input. This property only affects widgets with the WA_InputMethodEnabled attribute set, and is typically used to launch a virtual keyboard on devices which have very few or no keys.

    The property only has an effect on platforms which use software input panels, such as Windows CE.

    The default is platform dependent.

  • @PSI_lbc Thanks for response.

    This behavior occurs while testing the app on an embedded Linux system. Setting "autoSipEnabled" didn't seem to help.

    One additional piece of information: while debugging the app on the device with a mouse plugged in (there will be only touch input in production environment) if I right click on a textfield to bring up a context menu, the keyboard appears and seems to work correctly from then on. If nothing else, can I programmatically simulate this right-click behavior to work around the situation?

  • Another finding --
    If in my main.cpp I create a QMessageBox and call exec() on it before calling exec() on my application, the virtual keyboard works.