3

I have a few stand alone scripts and I am in the process of making a toolbar from them.

Most of my script have arguments like this :

##Points=vector
##Distance= number 2000
...

Those lines make a parameter window appear before the processing is done. This is the standard interface for stand-alone scripts.

Yet, is it possible to find a way to just link them in the plugins or do I have to make a new gui. Every button should be linked to one script.

Right now, the button have been done this way :

def initGui(self):
    """Create the menu entries and toolbar icons inside the QGIS GUI."""

    self.add_action(
        ':/plugins/Concentration/param.png',
        text=self.tr(u'Param'),
        callback=self.run,
        parent=self.iface.mainWindow())

    self.add_action(
        ':/plugins/Concentration/group.png',
        text=self.tr(u'Algorithmes de groupement'),
        callback=self.run,
        parent=self.iface.mainWindow())
...

So if I could just find away aroud the callback=self.run to run a script just like I do in qgis(like callback = Param.py), it will save me the time to remake an interface for those scripts.

Your Answer

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

Browse other questions tagged or ask your own question.