Android: Don't add QtEditText to foreign windows
We don't handle input on behalf of these windows, so we don't need a QtEditText for them. Any Qt managed child QWindow added to a foreign window will get its own QtEditText as normal. Change-Id: I32daa83f22487aadca7509379595b6c82b29ea4a Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> (cherry picked from commit eea00824bdbc6740261d2b78821e31c1f21c9c0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
c45da998ad
commit
b9022081b0
@ -24,17 +24,22 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
|
||||
private static native void setSurface(int windowId, Surface surface);
|
||||
static native void windowFocusChanged(boolean hasFocus, int id);
|
||||
|
||||
QtWindow(Context context, QtWindow parentWindow,
|
||||
QtWindow(Context context, boolean isForeignWindow, QtWindow parentWindow,
|
||||
QtInputConnection.QtInputConnectionListener listener)
|
||||
{
|
||||
super(context);
|
||||
setId(View.generateViewId());
|
||||
m_editText = new QtEditText(context, listener);
|
||||
m_inputConnectionListener = listener;
|
||||
setParent(parentWindow);
|
||||
setFocusableInTouchMode(true);
|
||||
addView(m_editText, new QtLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
|
||||
if (!isForeignWindow) {
|
||||
m_editText = new QtEditText(context, listener);
|
||||
addView(m_editText, new QtLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
} else {
|
||||
m_editText = null;
|
||||
}
|
||||
|
||||
QtNative.runAction(() -> {
|
||||
m_gestureDetector =
|
||||
|
@ -72,7 +72,8 @@ void QAndroidPlatformWindow::initialize()
|
||||
"getInputConnectionListener");
|
||||
|
||||
m_nativeQtWindow = QJniObject::construct<QtJniTypes::QtWindow>(
|
||||
QNativeInterface::QAndroidApplication::context(), m_nativeParentQtWindow, listener);
|
||||
QNativeInterface::QAndroidApplication::context(),
|
||||
isForeignWindow(), m_nativeParentQtWindow, listener);
|
||||
m_nativeViewId = m_nativeQtWindow.callMethod<jint>("getId");
|
||||
|
||||
if (window->isTopLevel())
|
||||
|
Loading…
x
Reference in New Issue
Block a user