Skip to content

Commit

Permalink
check if qt_api startswith PyQt
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed Aug 4, 2022
1 parent e96c540 commit 7662f26
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions msl/qt/_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,8 @@

Qt = QtCore.Qt

if qt_api.startswith('PySide'):
Signal = QtCore.Signal
Slot = QtCore.Slot
binding = Binding(
name=api.__name__,
version=api.__version__,
qt_version=QtCore.__version__,
version_info=api.__version_info__,
qt_version_info=QtCore.__version_info__,
)
else:
def _to_version_info(version):
if qt_api.startswith('PyQt'):
def to_version_info(version):
major = (version >> 16) & 0xff
minor = (version >> 8) & 0xff
patch = version & 0xff
Expand All @@ -80,8 +70,18 @@ def _to_version_info(version):
name=api.__name__,
version=QtCore.PYQT_VERSION_STR,
qt_version=QtCore.QT_VERSION_STR,
version_info=_to_version_info(QtCore.PYQT_VERSION),
qt_version_info=_to_version_info(QtCore.QT_VERSION),
version_info=to_version_info(QtCore.PYQT_VERSION),
qt_version_info=to_version_info(QtCore.QT_VERSION),
)
else:
Signal = QtCore.Signal
Slot = QtCore.Slot
binding = Binding(
name=api.__name__,
version=api.__version__,
qt_version=QtCore.__version__,
version_info=api.__version_info__,
qt_version_info=QtCore.__version_info__,
)

if not hasattr(QtWidgets.QApplication, 'exec'):
Expand Down

0 comments on commit 7662f26

Please sign in to comment.