Pyside/PyQt - Attach QWidget to QGraphicsItem


Has anyone been able to attach an standard QWidget to a QGraphicsItem, say a QSpinBox to modify a float value that the QGraphicsItem is representing?
I know it is possible to add a QWidget to a QGraphicsScene but I want to attach it to an Item in my Scene, rather than the scene itself.

Thanks muchly in advance.


I’m not sure QGraphicsItem supports that directly unless you paint it in yourself. I think what you’re looking for if you want to display widgets is an inheritor called QGraphicsWidget. Then you can just add it as a child of your custom QGraphicsItem.