diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-10-17 11:21:34 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-10-17 11:31:31 +0300 |
commit | 09691831380ca7c15cfed3445465e27837c4130d (patch) | |
tree | 230283a3041728afefff825e1e5fb6da019eeb3e /contrib/python/ipython/py3/IPython/external/qt_loaders.py | |
parent | 68f2bcc600fc15fb8400346624c43d6be3ec81b2 (diff) | |
download | ydb-09691831380ca7c15cfed3445465e27837c4130d.tar.gz |
Intermediate changes
commit_hash:2d9a1d3a3501b70a635f24b69a195c83059b71da
Diffstat (limited to 'contrib/python/ipython/py3/IPython/external/qt_loaders.py')
-rw-r--r-- | contrib/python/ipython/py3/IPython/external/qt_loaders.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/python/ipython/py3/IPython/external/qt_loaders.py b/contrib/python/ipython/py3/IPython/external/qt_loaders.py index 1486cf9d77..6058ee5a9a 100644 --- a/contrib/python/ipython/py3/IPython/external/qt_loaders.py +++ b/contrib/python/ipython/py3/IPython/external/qt_loaders.py @@ -302,13 +302,25 @@ def import_pyside6(): ImportErrors raised within this function are non-recoverable """ + + def get_attrs(module): + return { + name: getattr(module, name) + for name in dir(module) + if not name.startswith("_") + } + from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport # Join QtGui and QtWidgets for Qt4 compatibility. QtGuiCompat = types.ModuleType("QtGuiCompat") QtGuiCompat.__dict__.update(QtGui.__dict__) - QtGuiCompat.__dict__.update(QtWidgets.__dict__) - QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + if QtCore.__version_info__ < (6, 7): + QtGuiCompat.__dict__.update(QtWidgets.__dict__) + QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + else: + QtGuiCompat.__dict__.update(get_attrs(QtWidgets)) + QtGuiCompat.__dict__.update(get_attrs(QtPrintSupport)) return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6 |