2

In this case I want to launch the Georeferencer core plugin from within a plugin I have written in python. But I don't understand how to interact with the core C++ plugin system from python, if that's possible. My plugin displays a QFileDialog and I optionally want to launch the Georeferencer plugin after looking at the selected files.

class ImportRasterDialog(QtGui.QFileDialog, FORM_CLASS):
    # ...

    def on_ok_clicked(self):

        files = self.selectedFiles()
        # Do stuff with the selected files
        # Somehow launch the Georeferencer plugin with a selected file

My searches keep coming back to this thread on the QGIS-developer mailing list, but this seems to be about lower-level access the functions of the Georeferencer plugin, whereas I only need to launch it (with a selected file): https://www.mail-archive.com/qgis-developer@lists.osgeo.org/msg22060.html

I couldn't see any suitable functions available from QgsInterface.

I am quite new to QGIS development and to this stackexchange, please excuse me if this question is obvious.

  • 1
    I managed to launch the Georeferencer interface (without a selected file) by poking around at the QMenu returned by iface.rasterMenu: for a in iface.rasterMenu().actions(): if a.text() == 'Georeferencer': a.menu().actions()[0].activate(QAction.Trigger) – metazool Jan 14 '16 at 16:56

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.