Android: Allow to open Keyboard without touch
After changes in f4050cc5ea7490ba3b8b2bb0a174559d7e72a27e commit, the keyboard can be opened only when internal m_currentEditText is set (what is happening only on touch). Because of that, the keyboard cannot be opened just by setting focus on an item like it was before. To allow open the keyboard not only after touch, QtWindow needs to be informed about each focus change. Fixes: QTBUG-124360 Change-Id: Ic3ca4451f53df55bfb1f3e300078fd1916e77155 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2971dbfe062de6b0be3ed9f251f9506bd45d5854) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4cbef8822a
commit
b60db83faa
@ -236,4 +236,11 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
|
||||
if (m_parentWindow != null)
|
||||
m_parentWindow.addChildWindow(this);
|
||||
}
|
||||
|
||||
@UsedFromNativeCode
|
||||
void updateFocusedEditText()
|
||||
{
|
||||
if (m_editText != null && m_inputConnectionListener != null)
|
||||
m_inputConnectionListener.onEditTextChanged(m_editText);
|
||||
}
|
||||
}
|
||||
|
@ -299,8 +299,10 @@ void QAndroidPlatformScreen::topVisibleWindowChanged()
|
||||
QtAndroidMenu::setActiveTopLevelWindow(w);
|
||||
if (w && w->handle()) {
|
||||
QAndroidPlatformWindow *platformWindow = static_cast<QAndroidPlatformWindow *>(w->handle());
|
||||
if (platformWindow)
|
||||
if (platformWindow) {
|
||||
platformWindow->updateSystemUiVisibility();
|
||||
platformWindow->updateFocusedEditText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,6 +266,11 @@ void QAndroidPlatformWindow::updateSystemUiVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
void QAndroidPlatformWindow::updateFocusedEditText()
|
||||
{
|
||||
m_nativeQtWindow.callMethod<void>("updateFocusedEditText");
|
||||
}
|
||||
|
||||
bool QAndroidPlatformWindow::isExposed() const
|
||||
{
|
||||
return qApp->applicationState() > Qt::ApplicationHidden
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
void propagateSizeHints() override;
|
||||
void requestActivateWindow() override;
|
||||
void updateSystemUiVisibility();
|
||||
void updateFocusedEditText();
|
||||
inline bool isRaster() const { return m_isRaster; }
|
||||
bool isExposed() const override;
|
||||
QtJniTypes::QtWindow nativeWindow() const { return m_nativeQtWindow; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user