Add event listener on QGraphicsEllipseItem

المشرف العام

Administrator
طاقم الإدارة
I'm creating a QGis Plugin in python which has a QGraphicsView in which I draw and ellipse on which I want to detect if the user clicks.

I know the ellipse inherits QGraphicsItem which has a mouseReleaseEvent but I just don't know how to listen for an event.

self.scene = QGraphicsScene() //form.py ellipse = self.dock.scene.addEllipse(0, 0, 100, 100, QPen(), QBrush()) //plugin.py //now that i've got a reference to the ellipse how do I detect when someone clicks on it ?

أكثر...
 
أعلى