Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt.inputMethod.visible when keyboard invoked from JS in QML WebView
Forum Update on Monday, May 27th 2025

Qt.inputMethod.visible when keyboard invoked from JS in QML WebView

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 708 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tuffa
    wrote on 4 May 2018, 10:08 last edited by
    #1

    Hello,

    My app uses a Summernote editor in a QML WebView component which I am deploying to an Android device.

    When I click in the editor window, the keyboard is displayed, however in some cases the Summernote editor area is at the bottom of the device's screen, which becomes obscurred by the keyboard. I have read here and there that content may or may not be automtically be scrolled to accomodate a keyboard, however for me, that is not happening.

    So, I thought I might catch the visibleChanged() signal which is documented for Qt.inputMethod, and then somehow push the window content up. However, I appear unable to catch the signal.

    I wonder if the root of my problem is that the keyboard is raised as a result of JS within the QML WebView component, and so invalidates Qt support for Qt.inputMethod in this case?

        property bool keyboardAnimating : Qt.inputMethod.animating;
        property bool keyboardVisible : Qt.inputMethod.visible;
    
        onKeyboardVisibleChanged: {
    // this method never called
        }
    

    Any thoughts/help appreciated!

    Chris.

    T 1 Reply Last reply 4 May 2018, 15:16
    0
    • T Tuffa
      4 May 2018, 10:08

      Hello,

      My app uses a Summernote editor in a QML WebView component which I am deploying to an Android device.

      When I click in the editor window, the keyboard is displayed, however in some cases the Summernote editor area is at the bottom of the device's screen, which becomes obscurred by the keyboard. I have read here and there that content may or may not be automtically be scrolled to accomodate a keyboard, however for me, that is not happening.

      So, I thought I might catch the visibleChanged() signal which is documented for Qt.inputMethod, and then somehow push the window content up. However, I appear unable to catch the signal.

      I wonder if the root of my problem is that the keyboard is raised as a result of JS within the QML WebView component, and so invalidates Qt support for Qt.inputMethod in this case?

          property bool keyboardAnimating : Qt.inputMethod.animating;
          property bool keyboardVisible : Qt.inputMethod.visible;
      
          onKeyboardVisibleChanged: {
      // this method never called
          }
      

      Any thoughts/help appreciated!

      Chris.

      T Offline
      T Offline
      Tuffa
      wrote on 4 May 2018, 15:16 last edited by
      #2

      I solved this (to an extent) by modifying the AndroidManifest.xml to override the default behaviour for handling window-softkeyboard interaction. Specifically add the following to the <activity> tag:

      android:windowSoftInputMode="stateUnspecified|adjustResize"
      

      Ref: https://developer.android.com/guide/topics/manifest/activity-element#wsoft

      1 Reply Last reply
      0

      1/2

      4 May 2018, 10:08

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved