summaryrefslogtreecommitdiffstats
path: root/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
diff options
context:
space:
mode:
authorTinja Paavoseppä <tinja.paavoseppa@qt.io>2023-09-05 12:58:40 +0300
committerTinja Paavoseppä <tinja.paavoseppa@qt.io>2024-01-30 20:01:29 +0200
commit702c420f51d9d56ca056315387f224ec2dba3ff3 (patch)
treef704654ac67fdc42cb019969eca0f003cf4a4bbf /src/android/jar/src/org/qtproject/qt/android/QtWindow.java
parentb3441b4127813148a701b7d538453bfdbe2315a4 (diff)
Android: Add classes to embed QML into native Android
Add classes that make it possible to add QML as a View into a native Android app: QtView: Base class for QtQuickView, handles non-Quick dependent operations. In essence a Java ViewGroup class which loads a QWindow and embeds it into itself. QtEmbeddedLoader: Extends QtLoader for embedded case, creates the embedded version of QtActivityDelegate and provides an embedded-specific path to loading Qt libraries (Mostly just allows users to set the name of the main lib) QtAndroidWindowEmbedding namespace: Deals with calls from QtEmbeddedDelegate to create/destroy QWindow and from QtView to show the window. Take the QtEmbeddedDelegate introduced in an earlier commit into use, and add functionality for loading QWindows for QtViews and managing QtViews into it. Add a factory for creating instances of QtEmbeddedDelegate. The factory holds a map of QtEmbeddedDelegate objects and creates them, with the Activity as the key. This is to make it so that the same delegate can be used by multiple views which share the same Context. Known issues left: * keyboard focus not working, as with other child windows Pick-to: 6.7 Task-number: QTBUG-118872 Change-Id: I94a5f9b4f904c05cc6368cf20f273fcf10d31f17 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/android/jar/src/org/qtproject/qt/android/QtWindow.java')
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtWindow.java3
1 files changed, 2 insertions, 1 deletions
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 da744a8d01..4f27532c0d 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtWindow.java
@@ -140,7 +140,8 @@ public class QtWindow implements QtSurfaceInterface, QtLayout.QtTouchListener {
QtNative.runAction(new Runnable() {
@Override
public void run() {
- m_layout.setLayoutParams(new QtLayout.LayoutParams(w, h, x, y));
+ if (m_layout.getContext() instanceof QtActivityBase)
+ m_layout.setLayoutParams(new QtLayout.LayoutParams(w, h, x, y));
}
});
}