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 Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 725 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.
  • TuffaT Offline
    TuffaT Offline
    Tuffa
    wrote on 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.

    TuffaT 1 Reply Last reply
    0
    • TuffaT Tuffa

      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.

      TuffaT Offline
      TuffaT Offline
      Tuffa
      wrote on 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

      • Login

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