QgsMapCanvasItem and mouse events

1 message Options
Embed this post
Permalink
Florian El Ahdab

QgsMapCanvasItem and mouse events

Reply Threaded More More options
Print post
Permalink
Hello the list.

I have been working with QGis and python and I am currently trying to implement my own subclass of QgsMapCanvasItem in python to display mobile positions over the map. The mobile and "over the map" part work already.

I would also like those items to be somehow "interactive", and I am therefore trying to get the various mouse events that one can normally expect from a QGraphicsItem. I implemented the folowing methods: 
def mouseReleaseEvent(self, event):
def mousePressEvent(self, event):
def acceptedMouseEvents(self):

the boundingRect method has also been implemented and tested with a few item.isUnderMouse() tries in the python console.

The mouse events do not seem to be dispatched to my items and I don't understand why.

Maybe some of you already have the answer to this question.
The source code for my items is included.

Thank you for your help with this matter.

Florian


_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user

geographicitem.py (3K) Download Attachment