Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-139734

Qt.inputMethod.commit() fails if the control loses focus with virtual keyboard

XMLWordPrintable

    • Linux/Yocto

      When using application manager to launch the out-of-process application with TextField, the property text is not set when the field loses focus.

       

      The issue can be reproduced on yocto imx8 linux with Qt 6.8.3 using application manager to launch the out-of-process application where virtual keyboard is in the system-ui and it’s set to simple Chinese. When using mouse event over vnc, the code works correctly.

       

      The following code is used in the out-of-process application:

      TextField {
          id: root
          onFocusChanged: {
              if (!root.focus && root.preeditText !== "") {
                  Qt.inputMethod.commit()
              }
          }
      }
      

       

      Once the TextField loses focus, the predict text is displayed over the text, but the property text is not used.

      As a workaround, instead of calling Qt.inputMethod.commit() the text can be set with:

      root.text = root.preeditText

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            rgriebl Robert Griebl
            tiheikka Titta Heikkala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes