##// END OF EJS Templates
Fix use of pyside6 >= 6.7.0
Ian Thomas -
Show More
@@ -302,13 +302,24 b' def import_pyside6():'
302
302
303 ImportErrors raised within this function are non-recoverable
303 ImportErrors raised within this function are non-recoverable
304 """
304 """
305 def get_attrs(module):
306 return {
307 name: getattr(module, name)
308 for name in dir(module)
309 if not name.startswith("_")
310 }
311
305 from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport
312 from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport
306
313
307 # Join QtGui and QtWidgets for Qt4 compatibility.
314 # Join QtGui and QtWidgets for Qt4 compatibility.
308 QtGuiCompat = types.ModuleType("QtGuiCompat")
315 QtGuiCompat = types.ModuleType("QtGuiCompat")
309 QtGuiCompat.__dict__.update(QtGui.__dict__)
316 QtGuiCompat.__dict__.update(QtGui.__dict__)
310 QtGuiCompat.__dict__.update(QtWidgets.__dict__)
317 if QtCore.__version_info__ < (6, 7):
311 QtGuiCompat.__dict__.update(QtPrintSupport.__dict__)
318 QtGuiCompat.__dict__.update(QtWidgets.__dict__)
319 QtGuiCompat.__dict__.update(QtPrintSupport.__dict__)
320 else:
321 QtGuiCompat.__dict__.update(get_attrs(QtWidgets))
322 QtGuiCompat.__dict__.update(get_attrs(QtPrintSupport))
312
323
313 return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6
324 return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6
314
325
General Comments 0
You need to be logged in to leave comments. Login now