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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.13.0, 5.14.0, 5.15.0
    • Widgets: GraphicsView
    • None
    • 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
        2. PyQt513up.mov
          160 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bibr Andreas Aardal Hanssen
            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