Working on a new plugin I am trying to connect a custom function to the mouse right-clic signal while using the polygon selecting maptool.
I have activated the maptool through :
def run(self): self.iface.actionSelectPolygon().trigger()
And would now like to connect my selectSite function to a canvasReleaseEvent or similar signal. From an interesting tutorial here I adapted the code and tried the line below which failed :
def run(self): self.iface.actionSelectPolygon().trigger() result = QObject.connect(self.canvas.mapTool(), SIGNAL("canvasReleaseEvent()"), self.selectSite) def selectSite(self): QMessageBox.information( self.iface.mainWindow(),"Info", "in selectSite function" )
Is there another way around by connecting to a more generic Qt mouse click signal ?
Any ideas or hints on how I can achieve my goal ?