forked from winpython/winpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQtGui.py
More file actions
39 lines (33 loc) · 1 KB
/
QtGui.py
File metadata and controls
39 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Copyright © 2014-2015 Colin Duquesnoy
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""
Provides QtGui classes and functions.
"""
from . import PYQT6, PYQT5, PYSIDE2, PYSIDE6, PythonQtError
if PYQT6:
from PyQt6 import QtGui
from PyQt6.QtGui import *
# Map missing/renamed methods
QDrag.exec_ = QDrag.exec
QGuiApplication.exec_ = QGuiApplication.exec
QTextDocument.print_ = QTextDocument.print
# Allow unscoped access for enums inside the QtGui module
from .enums_compat import promote_enums
promote_enums(QtGui)
del QtGui
elif PYQT5:
from PyQt5.QtGui import *
elif PYSIDE2:
from PySide2.QtGui import *
elif PYSIDE6:
from PySide6.QtGui import *
QFontMetrics.width = QFontMetrics.horizontalAdvance
# Map DeprecationWarning methods
QDrag.exec_ = QDrag.exec
QGuiApplication.exec_ = QGuiApplication.exec
else:
raise PythonQtError('No Qt bindings could be found')