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

QGraphicsItem.setGraphicsEffect() not working properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 5.11.2
    • 1.1.0
    • PySide
    • a697423e4b5b37572a8a06a8904fc03b44d99f39

    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.

      Attachments

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            maciej.pawlisz Maciej Pawlisz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: