Details
Description
When composing text using an input method (I used "Pinyin - Simplified"), the input method session gets cancelled whenever a widget in the same window gets destructed.
In our application, updates from another thread are send to the main thread and cause some widgets to be created/destructed. When such an update happens while the input method widget is visible, it closes the input method widget.
In attachment I added a minimal example. To mimic updates which destruct widgets, I create a new QLabel and call deleteLater() every second. As you will notice it is impossible to compose text using the input method this way.
This is a regression (in Qt 5.6.0 this didn't happen). I think it got introduced by https://codereview.qt-project.org/c/qt/qtbase/+/203859. The intention here was to cancel a composition session when the focus changes, but in my example the focus doesn't change and still this code is triggered.
Attachments
For Gerrit Dashboard: QTBUG-86976 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
321228,3 | widgets: Don't report new focus object during clearFocus() unless needed | dev | qt/qtbase | Status: MERGED | +2 | 0 |
322738,2 | widgets: Don't report new focus object during clearFocus() unless needed | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |
322739,2 | widgets: Don't report new focus object during clearFocus() unless needed | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |