[Qgis-developer] Some questions about PyQGIS

Richard Duivenvoorde rdmailings at duif.net
Mon Apr 13 05:02:22 EDT 2009


Germán Carrillo wrote:
> 4. Implementing the QgsMapTool class I have no way to get the 
> DoubleClick event, I did this:
>     -------------
>     def canvasDoubleClickEvent(self,event):
>         print "Yes"
>     -------------
>    But it doesn't work. I get two Raise events instead of DoubleClick 
> one. (I really want the DoubleClick event)

Hi G,
hi hit this one also, you needs some "@pyqtSignature" magic

see par 3.7
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#connecting-signals-and-slots

my problem was calling a ok button method twice:
without the "@pyqtSignature" magic, the on_btnOk_clicked will be called 
two times: one clicked() and one clicked(bool checked)

@pyqtSignature("on_btnBrowse_clicked()")
def on_btnBrowse_clicked(self):
   print 'bla'

hope this helps

Regards,

Richard Duivenvoorde


More information about the Qgis-developer mailing list