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 Change-Id: I4b237166dee264a22b2e3dd1ca4d82e0cfce376b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit e703feea40108cdd11f8f0270cc82c2aa0e691cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
17e546ac7f
commit
3d01456b10
@ -331,7 +331,6 @@ class QtActivityDelegate extends QtActivityDelegateBase
|
||||
m_topLevelWindows.put(window.getId(), window);
|
||||
if (!m_splashScreenSticky)
|
||||
hideSplashScreen();
|
||||
m_inputDelegate.setFocusedView(window.getQtEditText());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user