Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1544

QGradient.stops() is not available on Pyside6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 6.0.1
    • PySide
    • 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:

      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:

      Test-QGradient-Stop.py

       

      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?
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            ndias Nuno Dias
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes