Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.13.0, 5.14.0, 5.15.0
-
None
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))