From 1689331e5e21c8a1778682913701763b0567d147 Mon Sep 17 00:00:00 2001 From: empyrical Date: Fri, 5 Jan 2018 19:43:38 -0700 Subject: [PATCH] Add basic PySide2 support --- quamash/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quamash/__init__.py b/quamash/__init__.py index e6b40d0..ffb2951 100644 --- a/quamash/__init__.py +++ b/quamash/__init__.py @@ -28,7 +28,7 @@ QtModule = __import__(QtModuleName) if not QtModule: - for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'): + for QtModuleName in ('PyQt5', 'PySide2', 'PyQt4', 'PySide'): try: QtModule = __import__(QtModuleName) except ImportError: @@ -42,8 +42,8 @@ QtCore = __import__(QtModuleName + '.QtCore', fromlist=(QtModuleName,)) QtGui = __import__(QtModuleName + '.QtGui', fromlist=(QtModuleName,)) -if QtModuleName == 'PyQt5': - from PyQt5 import QtWidgets +if QtModuleName in ('PyQt5', 'PySide2'): + QtWidgets = __import__(QtModuleName + '.QtWidgets', fromlist=(QtModuleName,)) QApplication = QtWidgets.QApplication else: QApplication = QtGui.QApplication