summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2024-03-05 08:36:56 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-07 23:01:32 +0000
commitcf6f0191be77b17e9e8f78e87b12ba99fbd0006e (patch)
treefa468acd440911a5bb0465b6b645340d86ddf824 /src/plugins
parent566fe27f4aa2e8b7116b6be21ca3f8c1961d2baa (diff)
Revert "QAndroidPlatformInputContext: send composition text and cursor jointly"
This reverts commit be3b9b2ab12f664c196d649e8c4247d70805d667. Reason for revert: Caused QTBUG-121561 Fixes: QTBUG-121561 Pick-to: 6.5 6.2 Change-Id: I4b59d97ede6c50d2575a7d7cebbe2291983dd19f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 46502f9705634f02626ee1057975463d1c0ae1f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c76dd919fd89a9cf4fcbbf162423d12f3b5d6090)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 68a1ba0d07..d8fe370333 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -1156,13 +1156,21 @@ bool QAndroidInputContext::focusObjectStopComposing()
m_composingCursor = -1;
- // commit composing text and cursor position
- QList<QInputMethodEvent::Attribute> attributes;
- attributes.append(
- QInputMethodEvent::Attribute(QInputMethodEvent::Selection, localCursorPos, 0));
- QInputMethodEvent event(QString(), attributes);
- event.setCommitString(m_composingText);
- sendInputMethodEvent(&event);
+ {
+ // commit the composing test
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(QString(), attributes);
+ event.setCommitString(m_composingText);
+ sendInputMethodEvent(&event);
+ }
+ {
+ // Moving Qt's cursor to where the preedit cursor used to be
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(
+ QInputMethodEvent::Attribute(QInputMethodEvent::Selection, localCursorPos, 0));
+ QInputMethodEvent event(QString(), attributes);
+ sendInputMethodEvent(&event);
+ }
return true;
}