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

Regression: QInputMethodEvent::Selection start does not work anymore with commit string

XMLWordPrintable

    • All

      From QInputMethodEvent::Selection documentation:

      If set, the edit cursor should be moved to the specified position in the editor text contents. In contrast with Cursor, this attribute does not work on the preedit text, but on the surrounding text. The cursor will be moved after the commit string has been committed, and the preedit string will be located at the new edit position. The start position specifies the new position and the length variable can be used to set a selection starting from that point. The value is unused.

      This does not work anymore causing a regression (for example) in Virtual Keyboard where you cannot set cursor to inside a pre-edit text anymore by clicking somewhere on the pre-edit text.

      See the attached app which demonstrates the API call. It sends QInputMethodEvent with commit string "Hello" and a Selection attribute start=2. The expected outcome would be to have "Hello" in the text field and cursor set to 2. But since https://codereview.qt-project.org/c/qt/qtdeclarative/+/354904 the declarative text input does not honor the Selection start attribute anymore. In contrast, a Selection without the commit string does move the cursor as expected.

        For Gerrit Dashboard: QTBUG-140400
        # Subject Branch Project Status CR V

            jakoivik Jarkko Koivikko
            jakoivik Jarkko Koivikko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change