From 6a61e9bee2604c7bb4c69b5ea37005151fbef75b Mon Sep 17 00:00:00 2001
From: wangdaye078 <96114871+wangdaye078@users.noreply.github.com>
Date: Mon, 2 Dec 2024 14:43:24 +0800
Subject: [PATCH 1/2] opengl compatible Qt5 and Qt6
---
extensions/PythonQt_QtAll/PythonQt_QtAll.pro | 8 +-
generator/typesystem_gui.xml | 168 +++++++++----------
generator/typesystem_opengl.xml | 148 +++++++++++++---
3 files changed, 209 insertions(+), 115 deletions(-)
diff --git a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
index 8881d00c1..7c668161f 100644
--- a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
+++ b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
@@ -11,10 +11,7 @@ isEmpty( PYTHONQTALL_CONFIG ) {
qtHaveModule(svg):CONFIG += PythonQtSvg
qtHaveModule(sql):CONFIG += PythonQtSql
qtHaveModule(network):CONFIG += PythonQtNetwork
- lessThan(QT_MAJOR_VERSION, 6) {
- # module is empty in Qt6
- qtHaveModule(opengl):CONFIG += PythonQtOpengl
- }
+ qtHaveModule(opengl):CONFIG += PythonQtOpengl
qtHaveModule(xml):CONFIG += PythonQtXml
qtHaveModule(xmlpatterns):CONFIG += PythonQtXmlpatterns
qtHaveModule(multimedia):CONFIG += PythonQtMultimedia
@@ -115,6 +112,9 @@ PythonQtNetwork {
PythonQtOpengl {
DEFINES += PYTHONQT_WITH_OPENGL
QT += opengl
+ equals(QT_MAJOR_VERSION, 6){
+ QT += openglwidgets
+ }
PythonQtCore: Xinclude (com_trolltech_qt_opengl)
QT += xml
}
diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml
index e77d69816..6d391e2b0 100644
--- a/generator/typesystem_gui.xml
+++ b/generator/typesystem_gui.xml
@@ -39,42 +39,42 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -498,8 +498,8 @@
-
-
+
+
@@ -3073,17 +3073,17 @@ PyObject* constScanLine(QImage* image, int line) {
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -3091,12 +3091,12 @@ PyObject* constScanLine(QImage* image, int line) {
-
-
-
-
-
-
+
+
+
+
+
+
@@ -3121,15 +3121,15 @@ PyObject* constScanLine(QImage* image, int line) {
-
+
-
-
+
+
@@ -3155,34 +3155,34 @@ PyObject* constScanLine(QImage* image, int line) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
@@ -3193,11 +3193,11 @@ PyObject* constScanLine(QImage* image, int line) {
-
+
-
-
+
+
diff --git a/generator/typesystem_opengl.xml b/generator/typesystem_opengl.xml
index b8de602c5..80a600250 100644
--- a/generator/typesystem_opengl.xml
+++ b/generator/typesystem_opengl.xml
@@ -1,43 +1,137 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
@@ -61,7 +155,7 @@
-
+
@@ -71,13 +165,13 @@
-
-
+
+
-
+
From f6b2402171704b0e428bd224c734da16217b5d9d Mon Sep 17 00:00:00 2001
From: wangdaye078 <96114871+wangdaye078@users.noreply.github.com>
Date: Mon, 2 Dec 2024 15:08:21 +0800
Subject: [PATCH 2/2] maybe better
---
extensions/PythonQt_QtAll/PythonQt_QtAll.pro | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
index 7c668161f..510b98c48 100644
--- a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
+++ b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
@@ -112,7 +112,7 @@ PythonQtNetwork {
PythonQtOpengl {
DEFINES += PYTHONQT_WITH_OPENGL
QT += opengl
- equals(QT_MAJOR_VERSION, 6){
+ greaterThan(QT_MAJOR_VERSION, 5){
QT += openglwidgets
}
PythonQtCore: Xinclude (com_trolltech_qt_opengl)