Skip to content

Commit 375a05d

Browse files
committed
qt6: workarounds for API 26/27 (Android 8.0/8.1)
1 parent 9e34708 commit 375a05d

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

pythonforandroid/bootstraps/qt6/build/templates/arrays.tmpl.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<resources>
33
<string-array name="load_local_libs">
44
<item>{{ arch }};libplugins_platforms_qtforandroid_{{ arch }}.so</item>
5-
<item>{{ arch }};libplugins_multimedia_androidmediaplugin_{{ arch }}.so</item>
6-
<item>{{ arch }};libQt6MultimediaQuick_{{ arch }}.so</item>
5+
<!-- <item>{{ arch }};libplugins_multimedia_androidmediaplugin_{{ arch }}.so</item>
6+
<item>{{ arch }};libQt6MultimediaQuick_{{ arch }}.so</item> -->
77

88
<!--
99
<item>{{ arch }};libplugins_networkinformation_qandroidnetworkinformation_{{ arch }}.so</item>
@@ -56,8 +56,8 @@
5656
<item>{{ arch }};Qt6ShaderTools_{{ arch }}</item>
5757
<item>{{ arch }};Qt6Svg_{{ arch }}</item>
5858
<!-- <item>{{ arch }};Qt6Xml_{{ arch }}</item> -->
59-
<item>{{ arch }};Qt6Multimedia_{{ arch }}</item>
60-
<item>{{ arch }};Qt6MultimediaQuick_{{ arch }}</item>
59+
<!-- <item>{{ arch }};Qt6Multimedia_{{ arch }}</item>
60+
<item>{{ arch }};Qt6MultimediaQuick_{{ arch }}</item> -->
6161
<item>{{ arch }};Qt6QuickControls2Basic_{{ arch }}</item>
6262
<item>{{ arch }};Qt6QuickControls2BasicStyleImpl_{{ arch }}</item>
6363
<item>{{ arch }};Qt6QuickControls2Material_{{ arch }}</item>

pythonforandroid/recipes/qt6/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Qt6Recipe(BootstrapNDKRecipe):
1515

1616
depends = ['python3', 'hostqt6']
1717
conflicts = ['sdl2', 'sdl3', 'genericndkbuild']
18-
patches = ['main-lib-abi-suffix.patch']
18+
patches = ['main-lib-abi-suffix.patch', 'compat-windowinsets.patch']
1919

2020
need_stl_shared = True
2121

@@ -149,6 +149,7 @@ def build_arch(self, arch):
149149
configure = configure.bake('-nomake', 'tests')
150150
configure = configure.bake('-nomake', 'examples')
151151
configure = configure.bake('-no-widgets')
152+
configure = configure.bake('-no-feature-getentropy') # getentropy is >=API28
152153

153154
configure = configure.bake('-submodules', ','.join(
154155
['qtbase', 'qtdeclarative', 'qtimageformats', 'qtmultimedia']))
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/qtbase/src/android/jar/src/org/qtproject/qt/android/QtWindow.java 2026-02-18 14:34:01.303592030 +0100
2+
+++ b/qtbase/src/android/jar/src/org/qtproject/qt/android/QtWindow.java 2026-02-18 15:31:35.354646891 +0100
3+
@@ -162,6 +162,7 @@
4+
5+
// Android 9 and 10 emulators don't seem to be able
6+
// to handle this, but let's have the logic here anyway
7+
+ try {
8+
DisplayCutout cutout = insets.getDisplayCutout();
9+
if (cutout != null) {
10+
left = Math.max(left, cutout.getSafeInsetLeft());
11+
@@ -169,7 +170,8 @@
12+
right = Math.max(right, cutout.getSafeInsetRight());
13+
bottom = Math.max(bottom, cutout.getSafeInsetBottom());
14+
}
15+
-
16+
+ } catch (Throwable e) {
17+
+ }
18+
// If a theme supports an action bar, sometimes it even if it's hidden
19+
// the insets might report values including the bar's height, not entirely
20+
// sure whether it's due to a delay or a bug, either way ensure the top

0 commit comments

Comments
 (0)