Emit signal when QGraphicsPathItem moves

Viewed 21

I have a class that inherits QGraphicsPathItem, and I'd like it to emit signals when user drags it around a QGraphicsView/QGraphicsScene. Since QGraphicsPathItem doesn't inherit QObject, this isn't possible out of the box. On the other hand, sublclasses of QGraphicsObject provide such signals, but don't have properties from QGraphicsPathItem that I need.

How can I get my QGraphicsPathItem subclass to emit signals when user moves it around? I've tried:

  • Multiple inheritance, with my class inheriting both QGraphicsPathItem and QGraphicsObject
  • Creating a child QGraphicsObject within my QGraphicsPathItem

I'm using pyside.

0 Answers
Related