From 99645044f0b7d58c815b2f2bb841b8ad0c139428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 24 May 2023 02:53:12 +0200 Subject: [PATCH] Now first tries to load PyQt6, and if it cannot be loaded, tries PyQt5 --- client-py3/full/src/UDSClient.py | 1 - client-py3/full/src/uds/ui/__init__.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client-py3/full/src/UDSClient.py b/client-py3/full/src/UDSClient.py index 57b6ec2db..6e53d4e86 100755 --- a/client-py3/full/src/UDSClient.py +++ b/client-py3/full/src/UDSClient.py @@ -38,7 +38,6 @@ import webbrowser import threading import typing -# First, try to use PyQt6, available on arm64, x86_64, i386, ... from uds.ui import QtCore, QtWidgets, QtGui, QSettings, Ui_MainWindow from uds.rest import RestApi, RetryException, InvalidVersion diff --git a/client-py3/full/src/uds/ui/__init__.py b/client-py3/full/src/uds/ui/__init__.py index 9cf8212e7..a8e1d6bf5 100644 --- a/client-py3/full/src/uds/ui/__init__.py +++ b/client-py3/full/src/uds/ui/__init__.py @@ -31,12 +31,13 @@ Author: Adolfo Gómez, dkmaster at dkmon dot com ''' # First, try to use PyQt6, available on arm64, x86_64, i386, ... try: - from PyQt6 import QtCore, QtWidgets, QtGui - from PyQt6.QtCore import QSettings + from PyQt6 import QtCore, QtWidgets, QtGui # type: ignore + from PyQt6.QtCore import QSettings # type: ignore from .qt6.UDSLauncherMac import Ui_MacLauncher from .qt6.UDSWindow import Ui_MainWindow from .qt6 import UDSResources_rc + QT_VERSION = 6 except ImportError: # If not found, try to use PyQt5 (not available on arm64) from PyQt5 import QtCore, QtWidgets, QtGui # type: ignore @@ -45,4 +46,6 @@ except ImportError: # If not found, try to use PyQt5 (not available on arm64) from .qt5.UDSLauncherMac import Ui_MacLauncher # type: ignore from .qt5.UDSWindow import Ui_MainWindow # type: ignore from .qt5 import UDSResources_rc # type: ignore + QT_VERSION = 5 +__all__ = ['QtCore', 'QtWidgets', 'QtGui', 'Ui_MacLauncher', 'Ui_MainWindow', 'UDSResources_rc', 'QSettings', 'QT_VERSION']