diff options
author | Bartlomiej Moskal <bartlomiej.moskal@qt.io> | 2021-02-03 11:55:16 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-09 07:34:39 +0000 |
commit | e3428a1d4e1d05922ba632f0b47cb5f0e631e8e9 (patch) | |
tree | d5b460994fd54a7202e2ce3b5547b943fab17e5c | |
parent | 18b1e8266fd98c3099724de3baf4e9a014fb72d5 (diff) |
QQuickTextControl: commit pre-edit after key press
New text should not be inserted during pre-edition. Before handling new
text from key press event pre-edition need to be commit.
Fixes: QTBUG-90362
Change-Id: Ib6a7d67738bba18b7e904347b3e631416063029b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5688486289f503dcde99578c72b7b768f19e8eb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 08af7e018c..616a2f889e 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -949,6 +949,12 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { if (q->isAcceptableInput(e)) { +#if QT_CONFIG(im) + // QTBUG-90362 + // Before key press event will be handled, pre-editing part should be finished + if (isPreediting()) + commitPreedit(); +#endif if (overwriteMode // no need to call deleteChar() if we have a selection, insertText // does it already |