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

Setting the focus to an editable item in a QAbstractItemView causes the IME to be enabled even if the item is not currently being edited, which causes confusion on Windows

    XMLWordPrintable

Details

    Description

      Try this, on Windows:

      1. Build and run the 'addressbook' example app.
      2. Add an entry beginning with 'a'.
      3. In the OS, choose Japanese IME and switch to Hiragana mode.
      4. Click on the new entry.
      5. Press a key (I used 'z').

      EXPECTED: Nothing happens, because the caret is not visible.
      ACTUAL: The IME completion box opens, confusingly.

      This seems to be caused by https://codereview.qt-project.org/#/c/202093/. Whenever focus is set on an item in QAbstractItemView, the IME is enabled by setting the flag WA_InputMethodEnabled if the item is editable.

      In this example app, all the items are set as editable (see TableModel::flags in tablemodel.cpp)

      I think it would be better if this flag was set when the editor was actually opened, and cleared again when the editor was closed, because you don't want to IME to appear when typing with the focus on an editable but not-current-being-edited item.

      This causes problems in our app, because we allow keystrokes to filter through from a list view to the main widget, and thus users expect that they can (e.g.) zoom in to the document (using 'z') whilst focus is in a list view in a surrounding panel.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jlarcombe James Larcombe
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes