Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
6.0.1
-
None
-
Tested using Python 3.7.7 x64, PySide6 (Version: 6.0.1) on Windows 10
-
e9bf3bda62590a42377d21ae0e5646f5401f982a (pyside/pyside-setup/dev) 4267fd4fa1e98557056c643d39fc276dc48091dd (pyside/pyside-setup/6.0)
Description
Pyside6 does not have QGradient.stops() function implemented.
It's likely a regression since it is implemented on PySide2 and Qt6:
- https://doc.qt.io/qtforpython-5/PySide2/QtGui/QGradient.html#PySide2.QtGui.PySide2.QtGui.QGradient.stops
- https://doc-snapshots.qt.io/qt6-dev/qgradient.html#stops
This function retrieves a list containing gradient stop points positions (position and color).
Attached is a minimal script containing an example that illustrates the issue:
Running this script using PySide2, this list is returned:
[(0.0, PySide2.QtGui.QColor.fromRgbF(1.000000, 0.000000, 0.000000, 1.000000)), (0.5, PySide2.QtGui.QColor.fromRgbF(0.000000, 1.000000, 0.000000, 1.000000)), (1.0, PySide2.QtGui.QColor.fromRgbF(0.000000, 0.000000, 1.000000, 1.000000))]
Using PySide6, this error is retrieved:
Traceback (most recent call last): File "d:/courses/PySide-PyQt/Examples/test.py", line 42, in paintEvent print(gradient.stops()) AttributeError: 'PySide6.QtGui.QLinearGradient' object has no attribute 'stops' QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?