Skip to content

Commit b6f03bd

Browse files
Merge pull request #14 from vcmi/qt5-fixes
Qt5 fixes
2 parents a530423 + 5491b7c commit b6f03bd

File tree

5 files changed

+111
-7
lines changed

5 files changed

+111
-7
lines changed

.github/workflows/rebuildDependencies.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
141141
# versions must be synced with: conan_patches/<package>/conandata.yml
142142
# if no custom patches are required for a package, it should be removed from here
143-
for p in minizip/1.3.1 flac/1.4.2 qt/5.15.16 ; do
143+
for p in minizip/1.3.1 flac/1.4.2 ; do
144144
IFS_OLD="$IFS"
145145
IFS=/
146146
read package version <<<"$p"
@@ -163,11 +163,12 @@ jobs:
163163
done
164164
165165
# TODO: remove LuaJIT when https://github.com/conan-io/conan-center-index/pull/26577 is merged
166-
- name: Build LuaJIT from PR changes
167-
if: ${{ !contains(matrix.conan_options, '"&:lua_lib=lua"') }}
166+
# TODO: remove Qt5 when https://github.com/conan-io/conan-center-index/pull/28251 is merged
167+
- name: Build LuaJIT & Qt5 from PR changes
168168
run: |
169169
cciForkRepo='cci-fork'
170170
branchName='vcmi'
171+
recipePathQt='recipes/qt'
171172
172173
git clone "https://github.com/kambala-decapitator/conan-center-index.git" "$cciForkRepo" \
173174
--branch "$branchName" \
@@ -179,23 +180,33 @@ jobs:
179180
cd "$cciForkRepo"
180181
git sparse-checkout set \
181182
recipes/luajit \
183+
$recipePathQt \
182184
183185
git checkout
184186
185-
for p in luajit/2.1.0-beta3 ; do
187+
for p in ${{ contains(matrix.conan_options, '"&:lua_lib=lua"') && ' ' || 'luajit/2.1.0-beta3' }} qt/5.15.16 ; do
186188
IFS_OLD="$IFS"
187189
IFS=/
188190
read package version <<<"$p"
189191
IFS="$IFS_OLD"
190192
191-
conan create "recipes/$package/all" \
193+
if [[ $package == qt ]] ; then
194+
packagePath="$recipePathQt/5.x.x"
195+
else
196+
packagePath="recipes/$package/all"
197+
fi
198+
199+
# Windows workaround for https://bugreports.qt.io/browse/QTBUG-84543
200+
PATH="$WINDOWS_PERL_DIR:$PATH" conan create "$packagePath" \
192201
--version=$version \
193202
$CONAN_PROFILES \
194203
--build=missing \
195-
--test-folder=
204+
--test-folder= \
205+
--core-conf core.sources.patch:extra_path=$CUSTOM_PATCHES_PATH \
206+
${{ startsWith(matrix.platform, 'android') && '-o "qt/*:android_sdk=$ANDROID_HOME"' || '' }}
196207
done
197208
198-
- name: Generate conan profile
209+
- name: Build the rest of the dependencies
199210
run: |
200211
conan install . \
201212
--output-folder=conan-generated \

conan_patches/qt/conandata.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
patches:
22
"5.15.16":
3+
- "base_path": "qt5/qtbase"
4+
"patch_file": "patches/android-19-jar.diff"
5+
- "base_path": "qt5/qtbase"
6+
"patch_file": "patches/android-19-java.diff"
37
- "base_path": "qt5/qtbase"
48
"patch_file": "patches/android-21-22.diff"
59
- "base_path": "qt5/qtbase"

conan_patches/qt/patches/_kde.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Patches from [KDE project](https://community.kde.org/Qt5PatchCollection) were generated from a72077a88903fe532f6a749677eb4da4ea99f79f, but a few had to be dropped because Conan can't apply them, namely:
2+
3+
- 0018-Fix-memory-leak
4+
- 0024-Use-icon-themes-in-QPrintPreviewDialog-if-they-exist
5+
- 0061-Annotate-QMutex-with-TSAN-annotations
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
2+
index 1218164..a5bd6c5 100644
3+
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
4+
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
5+
@@ -847,7 +847,10 @@ public class QtActivityDelegate
6+
m_splashScreenSticky = info.metaData.containsKey("android.app.splash_screen_sticky") && info.metaData.getBoolean("android.app.splash_screen_sticky");
7+
int id = info.metaData.getInt(splashScreenKey);
8+
m_splashScreen = new ImageView(m_activity);
9+
- m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id, m_activity.getTheme()));
10+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
11+
+ m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id, m_activity.getTheme()));
12+
+ else
13+
+ m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id));
14+
m_splashScreen.setScaleType(ImageView.ScaleType.FIT_XY);
15+
m_splashScreen.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
16+
m_layout.addView(m_splashScreen);
17+
@@ -1293,7 +1296,10 @@ public class QtActivityDelegate
18+
if (attr.type >= TypedValue.TYPE_FIRST_COLOR_INT && attr.type <= TypedValue.TYPE_LAST_COLOR_INT) {
19+
m_activity.getWindow().setBackgroundDrawable(new ColorDrawable(attr.data));
20+
} else {
21+
- m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId, m_activity.getTheme()));
22+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
23+
+ m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId, m_activity.getTheme()));
24+
+ else
25+
+ m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId));
26+
}
27+
if (m_dummyView != null) {
28+
m_layout.removeView(m_dummyView);
29+
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java b/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
30+
index e84c5d7..a3bbff4 100644
31+
--- a/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
32+
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
33+
@@ -109,8 +109,7 @@ public class QtMessageDialogHelper
34+
try {
35+
TypedValue typedValue = new TypedValue();
36+
m_theme.resolveAttribute(android.R.attr.alertDialogIcon, typedValue, true);
37+
- return m_activity.getResources().getDrawable(typedValue.resourceId,
38+
- m_activity.getTheme());
39+
+ return m_activity.getResources().getDrawable(typedValue.resourceId);
40+
} catch (Exception e) {
41+
e.printStackTrace();
42+
}
43+
@@ -120,8 +119,7 @@ public class QtMessageDialogHelper
44+
{
45+
case 1: // Information
46+
try {
47+
- return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_info,
48+
- m_activity.getTheme());
49+
+ return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_info);
50+
} catch (Exception e) {
51+
e.printStackTrace();
52+
}
53+
@@ -135,16 +133,14 @@ public class QtMessageDialogHelper
54+
// break;
55+
case 3: // Critical
56+
try {
57+
- return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert,
58+
- m_activity.getTheme());
59+
+ return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert);
60+
} catch (Exception e) {
61+
e.printStackTrace();
62+
}
63+
break;
64+
case 4: // Question
65+
try {
66+
- return m_activity.getResources().getDrawable(android.R.drawable.ic_menu_help,
67+
- m_activity.getTheme());
68+
+ return m_activity.getResources().getDrawable(android.R.drawable.ic_menu_help);
69+
} catch (Exception e) {
70+
e.printStackTrace();
71+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
2+
index 1e72aa3..982d060 100644
3+
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
4+
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
5+
@@ -182,7 +182,7 @@ public abstract class QtLoader {
6+
}
7+
// Implement in subclass
8+
9+
- private final List<String> supportedAbis = Arrays.asList(Build.SUPPORTED_ABIS);
10+
+ private final List<String> supportedAbis = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? Arrays.asList(Build.SUPPORTED_ABIS) : List.of(Build.CPU_ABI);
11+
private String preferredAbi = null;
12+
13+
private ArrayList<String> prefferedAbiLibs(String []libs)

0 commit comments

Comments
 (0)