Skip to content

Commit

Permalink
Don't load Qt3D modules for buggy versions of PySide2
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Jul 14, 2019
1 parent 9e86214 commit e94e5f5
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 36 deletions.
16 changes: 10 additions & 6 deletions qtpy/Qt3DAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DAnimation classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DAnimation import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DAnimation as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DAnimation):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DAnimation as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DAnimation):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')
16 changes: 10 additions & 6 deletions qtpy/Qt3DCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DCore classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DCore import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DCore as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DCore):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DCore as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DCore):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')
16 changes: 10 additions & 6 deletions qtpy/Qt3DExtras.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DExtras classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DExtras import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DExtras as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DExtras):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DExtras as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DExtras):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')
16 changes: 10 additions & 6 deletions qtpy/Qt3DInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DInput classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DInput import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DInput as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DInput):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DInput as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DInput):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')
16 changes: 10 additions & 6 deletions qtpy/Qt3DLogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DLogic classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DLogic import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DLogic as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DLogic):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DLogic as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DLogic):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')
16 changes: 10 additions & 6 deletions qtpy/Qt3DRender.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
"""Provides Qt3DRender classes and functions."""

# Local imports
from . import PYQT5, PYSIDE2, PythonQtError
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
from .py3compat import PY2

if PYQT5:
from PyQt5.Qt3DRender import *
elif PYSIDE2:
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DRender as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DRender):
globals()[__name[0]] = __name[1]
if PY2 and PYSIDE_VERSION < '5.12.4':
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
import PySide2.Qt3DRender as __temp
import inspect
for __name in inspect.getmembers(__temp.Qt3DRender):
globals()[__name[0]] = __name[1]
else:
raise PythonQtError('A bug in Shiboken prevents this')
else:
raise PythonQtError('No Qt bindings could be found')

0 comments on commit e94e5f5

Please sign in to comment.