Priority: P1: Critical
Affects Version/s: 5.12.6, 5.15.0, 6.0.0
Commits:7d5ba1c17ecbb620731ff7322fd278c3ce496dad (qt/qtbase/dev) a778580339427d745260db962e6f109739c5661f (qt/qtbase/5.12) ca979fd84461c1ec4bf232d6c4684261a9d55d4f (qt/qtbase/5.15)
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.
|For Gerrit Dashboard: QTBUG-86976|
|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|