summaryrefslogtreecommitdiffstats
path: root/src/android/jar
diff options
context:
space:
mode:
authorTinja Paavoseppä <tinja.paavoseppa@qt.io>2024-02-08 09:35:46 +0200
committerTinja Paavoseppä <tinja.paavoseppa@qt.io>2024-02-15 19:44:35 +0200
commite703feea40108cdd11f8f0270cc82c2aa0e691cd (patch)
tree5e96c620db848eda0aaf9714e64975b644e9206d /src/android/jar
parent2c192c6f5fe08b014bfa90ea0452258e649d3183 (diff)
Android: Request QtEditText focus when its window is touched
This allows switching focus between different Qt windows, which combined with the previous changes enables keyboard focus for child windows. Task-number: QTBUG-118139 Pick-to: 6.7 Change-Id: I4b237166dee264a22b2e3dd1ca4d82e0cfce376b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/android/jar')
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtWindow.java8
3 files changed, 1 insertions, 9 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
index 25ac59ec32..482ad2abd5 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
@@ -331,7 +331,6 @@ class QtActivityDelegate extends QtActivityDelegateBase
m_topLevelWindows.put(window.getId(), window);
if (!m_splashScreenSticky)
hideSplashScreen();
- m_inputDelegate.setFocusedView(window.getQtEditText());
});
}
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
index f11791ea09..2bdfa73d6d 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
@@ -214,7 +214,6 @@ class QtInputDelegate {
return;
setEditTextOptions(enterKeyType, inputHints);
- m_currentEditText.requestFocus();
m_currentEditText.postDelayed(() -> {
m_imm.showSoftInput(m_currentEditText, 0, new ResultReceiver(new Handler()) {
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtWindow.java b/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
index 2f8f9cfbdc..e5551f0d3d 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
@@ -45,13 +45,6 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
});
}
- // TODO this is a temporary workaround to be able to set the input delegate current edit text,
- // the next two patches make this redundant
- QtEditText getQtEditText()
- {
- return m_editText;
- }
-
void setVisible(boolean visible) {
QtNative.runAction(() -> {
if (visible)
@@ -70,6 +63,7 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
@Override
public boolean onTouchEvent(MotionEvent event)
{
+ m_editText.requestFocus();
event.setLocation(event.getX() + getX(), event.getY() + getY());
QtInputDelegate.sendTouchEvent(event, getId());
m_gestureDetector.onTouchEvent(event);