Details
Description
from PySide.QtGui import *
app = QApplication([])
scene = QGraphicsScene()
scene.addItem(it)
view = QGraphicsView(scene)
it = QGraphicsRectItem(0, 0, 100, 100)
shadow = QGraphicsDropShadowEffect()
it.setGraphicsEffect(shadow)
shadow = None
view.show()
app.exec_()
There is no shadow under rectangle, probably because QGraphicsDropShadowEffect object was destroyed. Documentation says that QGraphicsItem takes ownership of that object, so it should not happen.
Commenting line shadow = None would help, but this causes errors in some advanced situations, when QGraphicsItem "owning" this shadow gets deleted, and C++ shadow object gets deleted also, but python object stays untouched. Caused a crash in my application without any notice, when I was changing and drawing scenes.