[PyQt] QGraphicsObject added to scene transforms into something else?
phil at riverbankcomputing.com
Fri Feb 13 16:26:34 GMT 2015
On 13/02/2015 4:20 pm, Alan Ezust wrote:
> I don't have a test case yet, but I guess I will have to make one.
> Have any of you heard of a problem like this before?
> I created a QGraphicsObject-derived class.
> Added an instance to the scene.
> Before adding it, I can print it to stdout and see its type/address:
> <origame.gui.actor_2d_view.actor2d_view.PartWire2dItem object at
> But after I add it to the scene, this particular object "goes away" and
> its place, I find this other item which I never added to the scene:
> <PyQt5.QtMultimediaWidgets.QGraphicsVideoItem object at
> The item still paints itself as a PartWire2dItem should.
> Why would both the address and the type change as I add it to the
> Is there some sort of class registration I need to do in order to my
> objects properly?
> Or could this be a side-effect of perhaps forgetting to implement one
> the pure virtual functions?
> Sorry if this is not enough info for you to figure things out yet, I
> post a testcase when I have one....
Make sure you re-implement type() and return a value greater than
More information about the PyQt