QGIS allows you to write plugins in Python. You can use Python in various ways in conjunction with QGIS, and writing plugins is one way to use it.
What you can do with QGIS and Python is described on the following page of the official website. http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/
Corresponding page of the official website about plugin creation http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html#developing-plugins
Procedure article in English by a user (but Googler) http://www.qgistutorials.com/en/docs/building_a_python_plugin.html
There is a plug-in that can generate the required set of files, so here are the steps to prepare a set of files using it.
--Plugin Builder (Plugin Generation Plugin) --Qt Designer (GUI editing tool) - Qt Creator on Mac (http://qt-project.org/downloads) --Qt Designer on Ubuntu (installed with apt-get.'sudo apt-get install qt4-designer') - WinPython on Windows (http://winpython.sourceforge.net/) --Plugin Reloader (A plugin that can reflect the modified contents without restarting the application when modifying the function on the plugin. It is not essential)
Launch Plugin Builder from the QGIS Plugins menu.
Enter the required items and press the OK button. You will be asked for the storage location. You can save it anywhere, but QGIS will not recognize it unless you save it in a location that QGIS recognizes as a plugin folder.
For Mac, the following location is where to put the default plugins. /Users/(username)/.qgis2/python/plugins
Folders with a. Are not displayed in the default Finder and cannot be moved in the GUI, but you can be sure to select the menu "Move"-> "Move to Folder ..." and enter the above file path. Or move the folder with CUI.
You can customize the icon image to be displayed on QGIS. However, you need to convert it so that QGIS can read it with the provided tool. Although this file is required, it is not included in the file generated by this tool, so you need to execute the conversion instruction once regardless of whether you customize it or not. Execute the following command in the plugin directory.
pyrcc4 -o resources_rc.py resources.qrc
Resources.qrc that describes the existence of the icon image in XML format is generated.
-Edit ***._dialog_base.ui ( is the plugin name) with Qt Creator.
-***. Py ( is the plugin name). --When loading an external library, write it at the beginning of this file. -The minimum required functions are: --init Required to be accessible from QGIS --intGui () Executed when the plugin is loaded --unload () Executed when the plugin exits --Run (self) Describe the contents of the plugin
Recommended Posts