Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86856

Animating QGraphicsDropShadowEffect's blurRadius is jittery on PyQt5.13 and up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0, 5.14.0, 5.15.0
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      macOS

      Description

      On PyQt5.12, animating the blurRadius of a shadow effect is smooth (see PyQt512.mov). On higher versions, it gives the shadow a jittery flashing effect (see PyQt513up.mov).

      I'm unsure whether this affects only macOS or other platforms as well.

      Code example:

      import sys
      from PyQt5.QtCore import QPropertyAnimation
      from PyQt5.QtGui import QPainter, QColor
      from PyQt5.QtWidgets import QApplication, QGraphicsScene, QGraphicsView, QGraphicsDropShadowEffect
      
      def main(argv):
          app = QApplication(argv)
          view = QGraphicsView()
          view.setRenderHint(QPainter.Antialiasing)
          scene = QGraphicsScene(view)
          view.setScene(scene)
          item = scene.addEllipse(30, 30, 40, 40)
          item.setBrush(QColor(0, 0, 0, 255))
          effect = QGraphicsDropShadowEffect()
          effect.setOffset(0, 0)
          item.setGraphicsEffect(effect)
          anim = QPropertyAnimation(effect, b"blurRadius", effect)
          anim.setStartValue(0)
          anim.setEndValue(50)
          anim.setDuration(1000)
          anim.setLoopCount(-1)
          anim.start()
          view.show()
          return app.exec()
      
      if __name__ == "__main__":
          sys.exit(main(sys.argv))
      

        Attachments

        1. PyQt512.mov
          123 kB
          Rafael Irgolič
        2. PyQt513up.mov
          160 kB
          Rafael Irgolič
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            bibr Andreas Aardal Hanssen
            Reporter:
            irgolic Rafael Irgolič
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes