Skip to content

Commit

Permalink
Merge pull request #88 from empyrical/pyside2
Browse files Browse the repository at this point in the history
Add basic PySide2 support
  • Loading branch information
harvimt authored May 9, 2019
2 parents 8021f43 + 460e11c commit 9e98599
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions quamash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
QtModule = importlib.import_module(QtModuleName)

if not QtModule:
for QtModuleName in ('PyQt5', 'PyQt4', 'PySide'):
for QtModuleName in ('PyQt5', 'PySide2', 'PyQt4', 'PySide'):
try:
QtModule = importlib.import_module(QtModuleName)
except ImportError:
Expand All @@ -37,10 +37,10 @@

logger.info('Using Qt Implementation: {}'.format(QtModuleName))

QtCore = importlib.import_module(QtModuleName + '.QtCore', package=QtModuleName)
QtGui = importlib.import_module(QtModuleName + '.QtGui', package=QtModuleName)
if QtModuleName == 'PyQt5':
from PyQt5 import QtWidgets
QtCore = __import__(QtModuleName + '.QtCore', fromlist=(QtModuleName,))
QtGui = __import__(QtModuleName + '.QtGui', fromlist=(QtModuleName,))
if QtModuleName in ('PyQt5', 'PySide2'):
QtWidgets = __import__(QtModuleName + '.QtWidgets', fromlist=(QtModuleName,))
QApplication = QtWidgets.QApplication
else:
QApplication = QtGui.QApplication
Expand Down

0 comments on commit 9e98599

Please sign in to comment.