summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <[email protected]>2022-12-20 12:02:46 +0100
committerQt Cherry-pick Bot <[email protected]>2022-12-21 13:39:19 +0000
commit10772b6f7b5297b433954f399b8f1d20a68671ca (patch)
tree65cfd71e7db9f68559fbff025fa2db76dd127ef1
parent9929a83183ddd3917b8c27a2c50fb83941269924 (diff)
Android input context: don't connect to non-existing signal
Not all focus objects have a cursorPositionChanged signal, so don't connect unless there is one. The code should perhaps not show the software keyboard at all unless the focus object responds to the input method query with cursor positions, but that's for a different patch. Change-Id: I0e01da42e96eb579d260b9158f005ad3215d0c26 Reviewed-by: Assam Boudjelthia <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> (cherry picked from commit f21c4500a6d4787d679d13e859b34d6c6a7a8c0e) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 679c142289d..4c111be8294 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -896,9 +896,11 @@ void QAndroidInputContext::showInputPanel()
return;
disconnect(m_updateCursorPosConnection);
+ m_updateCursorPosConnection = {};
+
if (qGuiApp->focusObject()->metaObject()->indexOfSignal("cursorPositionChanged(int,int)") >= 0) // QLineEdit breaks the pattern
m_updateCursorPosConnection = connect(qGuiApp->focusObject(), SIGNAL(cursorPositionChanged(int,int)), this, SLOT(updateCursorPosition()));
- else
+ else if (qGuiApp->focusObject()->metaObject()->indexOfSignal("cursorPositionChanged()") >= 0)
m_updateCursorPosConnection = connect(qGuiApp->focusObject(), SIGNAL(cursorPositionChanged()), this, SLOT(updateCursorPosition()));
QRect rect = screenInputItemRectangle();