Qt 5.6 android qml webview handle keyboard: HELP! BUG in WebView:!

  • Hey guys,
    i have a problem with the webview and virtual keyboard (android's).

    I have a fullscreen Webview which loads correctly:


    The problem is when i need to handle the size of this webview taking into account if the keyboard have been shown. If it were a normal qml control it would be a simple onFocus handling, but then i focus into a text field in the loaded webpage there is no way for me to know if the keyboard is shown and the size of it.
    I think Qt.inputMethod should be updated even if the event was not triggered a Qt control.
    To put it in a clearer way, i need to know the size of the shown keyboard to handle the webview's size because the keyboard overlaps the webview.

    Please help!

    ----- BUG ------
    The Qt.inputMethod does not recieves changes if the focus is on WebView. Havent tested many cases, but it applies to the problem presented above.

  • To solve it for android it was as simple as adding this android:windowSoftInputMode="adjustResize" to the activity property in the AndroidManifest.xml.
    I think Qt for android is highly untested, i have this luck to get the bugs in my face.

    Maybe calling it a bug is incorrect, more like " a hidden feature only encountered by those lost souls called early implementers. "

    Its a bug, in the documentation. :P

  • Lifetime Qt Champion


    AFAIK, the QtWebView module is TP so that's the kind of thing that may have slipped through. You should take a look at the bug report system to see if there's already something about it. If not then please consider opening a new report.