2

I tried calling the select free hand tool by below snippet of code.

iface.actionSelectFreehand().trigger()

I dnt have any idea how to call this when i am pressing a button in GUI. my gui is attached below

enter image description here

When Select Area from Map is pressed i want the select free hand to be called in my plugin. FYI the name of Select Area from Map in QTDEsigner is areapushbutton.

4

You don't really seem to have read at least one of the resources I collected for you in Layer properties dialog in my QGIS plugin.

If you open, for example this one, you'll see the answer to your question:

button.clicked.connect(self.onClicked)

In your case it would be something like (you might need to edit it to match your plugin structure):

self.areapushbutton.clicked.connect( self.iface.actionSelectFreehand().trigger )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.