QGraphicsScene

Stefan de Konink stefan at konink.de
Fri May 7 10:46:41 BST 2021


On Thursday, May 6, 2021 10:24:52 PM CEST, Luca Bertolotti wrote:
> i never get the event what is wrong??

I don't know if you are clicking on for example QGraphicsPathItem, and want 
to receive events there, but my epiphany was:

    # In order to receive individual events in a GraphicsScene, the 
sceneEvent must be implemented.
    def sceneEvent(self, event: QEvent):
        if (event.type() == QEvent.GraphicsSceneMouseMove):
             self.mouseMoveEvent(event)
        event.accept()
        return True

-- 
Stefan


More information about the PyQt mailing list