Skip to content

Commit ee98657

Browse files
committed
Promote unscoped enums in many other modules for PyQt6
1 parent 347f86b commit ee98657

20 files changed

+140
-0
lines changed

qtpy/Qt3DAnimation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
) from error
2626
elif PYQT6:
2727
try:
28+
from PyQt6 import Qt3DAnimation
2829
from PyQt6.Qt3DAnimation import *
30+
31+
# Allow unscoped access for enums
32+
from .enums_compat import promote_enums
33+
34+
promote_enums(Qt3DAnimation)
35+
del Qt3DAnimation
2936
except ModuleNotFoundError as error:
3037
raise QtModuleNotInstalledError(
3138
name="Qt3DAnimation",

qtpy/Qt3DRender.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
) from error
2626
elif PYQT6:
2727
try:
28+
from PyQt6 import Qt3DRender
2829
from PyQt6.Qt3DRender import *
30+
31+
# Allow unscoped access for enums
32+
from .enums_compat import promote_enums
33+
34+
promote_enums(Qt3DRender)
35+
del Qt3DRender
2936
except ModuleNotFoundError as error:
3037
raise QtModuleNotInstalledError(
3138
name="Qt3DRender",

qtpy/QtDBus.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
if PYQT5:
2222
from PyQt5.QtDBus import *
2323
elif PYQT6:
24+
from PyQt6 import QtDBus
2425
from PyQt6.QtDBus import *
26+
27+
# Allow unscoped access for enums
28+
from .enums_compat import promote_enums
29+
30+
promote_enums(QtDBus)
31+
del QtDBus
2532
elif PYSIDE2:
2633
raise QtBindingMissingModuleError(name="QtDBus")
2734
elif PYSIDE6:

qtpy/QtDesigner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
if PYQT5:
1919
from PyQt5.QtDesigner import *
2020
elif PYQT6:
21+
from PyQt6 import QtDesigner
2122
from PyQt6.QtDesigner import *
23+
24+
# Allow unscoped access for enums
25+
from .enums_compat import promote_enums
26+
27+
promote_enums(QtDesigner)
28+
del QtDesigner
2229
elif PYSIDE2:
2330
raise QtBindingMissingModuleError(name="QtDesigner")
2431
elif PYSIDE6:

qtpy/QtHelp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
if PYQT5:
1313
from PyQt5.QtHelp import *
1414
elif PYQT6:
15+
from PyQt6 import QtHelp
1516
from PyQt6.QtHelp import *
17+
18+
# Allow unscoped access for enums
19+
from .enums_compat import promote_enums
20+
21+
promote_enums(QtHelp)
22+
del QtHelp
1623
elif PYSIDE2:
1724
from PySide2.QtHelp import *
1825
elif PYSIDE6:

qtpy/QtMultimedia.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
if PYQT5:
1313
from PyQt5.QtMultimedia import *
1414
elif PYQT6:
15+
from PyQt6 import QtMultimedia
1516
from PyQt6.QtMultimedia import *
17+
18+
# Allow unscoped access for enums
19+
from .enums_compat import promote_enums
20+
21+
promote_enums(QtMultimedia)
22+
del QtMultimedia
1623
elif PYSIDE2:
1724
from PySide2.QtMultimedia import *
1825
elif PYSIDE6:

qtpy/QtNetwork.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
if PYQT5:
1414
from PyQt5.QtNetwork import *
1515
elif PYQT6:
16+
from PyQt6 import QtNetwork
1617
from PyQt6.QtNetwork import *
18+
19+
# Allow unscoped access for enums
20+
from .enums_compat import promote_enums
21+
22+
promote_enums(QtNetwork)
23+
del QtNetwork
1724
elif PYSIDE2:
1825
from PySide2.QtNetwork import *
1926
elif PYSIDE6:

qtpy/QtOpenGL.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@
3636
from PyQt5.QtGui import QOpenGLTimeMonitor, QOpenGLTimerQuery
3737

3838
elif PYQT6:
39+
from PyQt6 import QtOpenGL
3940
from PyQt6.QtGui import QOpenGLContext, QOpenGLContextGroup
4041
from PyQt6.QtOpenGL import *
42+
43+
# Allow unscoped access for enums
44+
from .enums_compat import promote_enums
45+
46+
promote_enums(QtOpenGL)
47+
del QtOpenGL
4148
elif PYSIDE6:
4249
from PySide6.QtGui import QOpenGLContext, QOpenGLContextGroup
4350
from PySide6.QtOpenGL import *

qtpy/QtOpenGLWidgets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
if PYQT5:
1919
raise QtBindingMissingModuleError(name="QtOpenGLWidgets")
2020
elif PYQT6:
21+
from PyQt6 import QtOpenGLWidgets
2122
from PyQt6.QtOpenGLWidgets import *
23+
24+
# Allow unscoped access for enums
25+
from .enums_compat import promote_enums
26+
27+
promote_enums(QtOpenGLWidgets)
28+
del QtOpenGLWidgets
2229
elif PYSIDE2:
2330
raise QtBindingMissingModuleError(name="QtOpenGLWidgets")
2431
elif PYSIDE6:

qtpy/QtPositioning.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
if PYQT5:
1313
from PyQt5.QtPositioning import *
1414
elif PYQT6:
15+
from PyQt6 import QtPositioning
1516
from PyQt6.QtPositioning import *
17+
18+
# Allow unscoped access for enums
19+
from .enums_compat import promote_enums
20+
21+
promote_enums(QtPositioning)
22+
del QtPositioning
1623
elif PYSIDE2:
1724
from PySide2.QtPositioning import *
1825
elif PYSIDE6:

0 commit comments

Comments
 (0)