Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.6, 5.10.1, 5.11.1
-
None
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.