From cc32662cfe9177f959638f256658991414e68c88 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Fri, 3 May 2024 12:48:11 +0200 Subject: [PATCH] Expose more Qt modules --- AnyQt/QtCharts.py | 16 ++++++++++++++++ AnyQt/QtDataVisualization.py | 16 ++++++++++++++++ AnyQt/QtLocation.py | 16 ++++++++++++++++ AnyQt/QtNetworkAuth.py | 16 ++++++++++++++++ AnyQt/QtPdf.py | 16 ++++++++++++++++ AnyQt/QtPdfWidgets.py | 16 ++++++++++++++++ AnyQt/QtPositioning.py | 16 ++++++++++++++++ AnyQt/QtRemoteObjects.py | 16 ++++++++++++++++ AnyQt/QtSvg.py | 2 ++ test/test_import.py | 12 ++++++++++-- 10 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 AnyQt/QtCharts.py create mode 100644 AnyQt/QtDataVisualization.py create mode 100644 AnyQt/QtLocation.py create mode 100644 AnyQt/QtNetworkAuth.py create mode 100644 AnyQt/QtPdf.py create mode 100644 AnyQt/QtPdfWidgets.py create mode 100644 AnyQt/QtPositioning.py create mode 100644 AnyQt/QtRemoteObjects.py diff --git a/AnyQt/QtCharts.py b/AnyQt/QtCharts.py new file mode 100644 index 0000000..5281e3f --- /dev/null +++ b/AnyQt/QtCharts.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtCharts import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtCharts import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtCharts import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtCharts import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtCharts import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtCharts import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtDataVisualization.py b/AnyQt/QtDataVisualization.py new file mode 100644 index 0000000..9d48a83 --- /dev/null +++ b/AnyQt/QtDataVisualization.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtDataVisualization import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtDataVisualization import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtDataVisualization import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtDataVisualization import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtDataVisualization import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtDataVisualization import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtLocation.py b/AnyQt/QtLocation.py new file mode 100644 index 0000000..31a0597 --- /dev/null +++ b/AnyQt/QtLocation.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtLocation import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtLocation import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtLocation import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtLocation import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtLocation import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtLocation import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtNetworkAuth.py b/AnyQt/QtNetworkAuth.py new file mode 100644 index 0000000..c4792de --- /dev/null +++ b/AnyQt/QtNetworkAuth.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtNetworkAuth import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtNetworkAuth import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtNetworkAuth import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtNetworkAuth import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtNetworkAuth import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtNetworkAuth import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtPdf.py b/AnyQt/QtPdf.py new file mode 100644 index 0000000..1a618f9 --- /dev/null +++ b/AnyQt/QtPdf.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtPdf import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtPdf import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtPdf import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtPdf import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtPdf import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtPdf import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtPdfWidgets.py b/AnyQt/QtPdfWidgets.py new file mode 100644 index 0000000..be50309 --- /dev/null +++ b/AnyQt/QtPdfWidgets.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtPdfWidgets import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtPdfWidgets import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtPdfWidgets import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtPdfWidgets import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtPdfWidgets import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtPdfWidgets import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtPositioning.py b/AnyQt/QtPositioning.py new file mode 100644 index 0000000..84e9cd6 --- /dev/null +++ b/AnyQt/QtPositioning.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtPositioning import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtPositioning import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtPositioning import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtPositioning import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtPositioning import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtPositioning import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtRemoteObjects.py b/AnyQt/QtRemoteObjects.py new file mode 100644 index 0000000..2345b2f --- /dev/null +++ b/AnyQt/QtRemoteObjects.py @@ -0,0 +1,16 @@ +from . import _api + +if _api.USED_API == _api.QT_API_PYQT6: + from PyQt6.QtRemoteObjects import * +elif _api.USED_API == _api.QT_API_PYQT5: + from PyQt5.QtRemoteObjects import * +elif _api.USED_API == _api.QT_API_PYQT4: + from PyQt4.QtRemoteObjects import * +elif _api.USED_API == _api.QT_API_PYSIDE: + from PySide.QtRemoteObjects import * +elif _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtRemoteObjects import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtRemoteObjects import * + +_api.apply_global_fixes(globals()) diff --git a/AnyQt/QtSvg.py b/AnyQt/QtSvg.py index 1668071..14afec0 100644 --- a/AnyQt/QtSvg.py +++ b/AnyQt/QtSvg.py @@ -11,5 +11,7 @@ from PySide.QtSvg import * elif _api.USED_API == _api.QT_API_PYSIDE2: from PySide2.QtSvg import * +elif _api.USED_API == _api.QT_API_PYSIDE6: + from PySide6.QtSvg import * _api.apply_global_fixes(globals()) diff --git a/test/test_import.py b/test/test_import.py index 1a52179..46a6d83 100644 --- a/test/test_import.py +++ b/test/test_import.py @@ -27,6 +27,12 @@ submodules_qt4 = [ 'QtXmlPatterns' ] + +submodules_common_qt56 = [ + "QtPositioning", + "QtRemoteObjects", +] + submodules_qt5 = [ 'QtMultimediaWidgets', 'QtWebChannel', @@ -35,10 +41,12 @@ 'QtWebSockets', 'QtQml', 'QtXmlPatterns', + "QtLocation", ] submodules_qt6 = [ "QtSvgWidgets", + "QtPdfWidgets", ] @@ -68,9 +76,9 @@ def try_import_anyqt(modname, submodule): if qt_version[0] == '4': submodules.extend(submodules_qt4) if qt_version[0] == '5': - submodules.extend(submodules_qt5) + submodules.extend(submodules_qt5 + submodules_common_qt56) if qt_version[0] == '6': - submodules.extend(submodules_qt6) + submodules.extend(submodules_qt6 + submodules_common_qt56) for submodule in submodules: if try_import_anyqt(modname, submodule): print(submodule, 'Ok')