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>bb10
parent
2c192c6f5f
commit
e703feea40
|
|
@ -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…
Reference in New Issue