PySide6 : shim missing binding QGradient.setStops

This commit is contained in:
KIU Shueng Chuan 2021-01-22 12:29:23 +08:00
parent 3a9e81cc49
commit 2e688cf672

View File

@ -390,6 +390,15 @@ if QT_LIB in [PYQT4, PYQT5, PYQT6]:
QtCore.Signal = QtCore.pyqtSignal
if QT_LIB == PYSIDE6:
# PySide6 6.0 has a missing binding
if not hasattr(QtGui.QGradient, 'setStops'):
def __setStops(self, stops):
for pos, color in stops:
self.setColorAt(pos, color)
QtGui.QGradient.setStops = __setStops
if QT_LIB == PYQT6:
# module.Class.EnumClass.Enum -> module.Class.Enum
def promote_enums(module):