From e3428a1d4e1d05922ba632f0b47cb5f0e631e8e9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Moskal Date: Wed, 3 Feb 2021 11:55:16 +0100 Subject: 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 Reviewed-by: Assam Boudjelthia (cherry picked from commit 5688486289f503dcde99578c72b7b768f19e8eb9) Reviewed-by: Qt Cherry-pick Bot --- src/quick/items/qquicktextcontrol.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3