How to Make a QGIS Plugin

preview_player
Показать описание
Video #110
This is a longer video than usual :)
You do not need to know much about python to follow this and if you know python well, the video should still help you clarify the plugin build process.

In the video I create a Hello Mars plugin - in honour of Ingenuity flying around on Mars. After all, its ALWAYS been Hello World and now we have moved on... :)

The info you need:

Your default plugin folder:
C:\Users\YOU\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\

QTDesigner can be found in the Start Menu and is installed by QGIS

Install PB-TOOL:
py -m pip install pb-tool

Use this to upgrade PIP if you need to (I did!): py -m pip install --upgrade pip

To compile your resources, you also need:
py -m pip install pyqt5ac

Make sure your PATH is set to be able to see your Python .exes and also scripts. Just type PY or PBT at command line to see if it all hangs together***

Use *pbt compile* in your plugin folder and then use Manage Plugins in QGIS to add your plugin.

All the info on the PB-TOOL can be discovered here:

And all about PyQt5 can be found here:

***If typing PBT gives you an error...
If you go to the Windows command line by clicking on start menu and type “CMD” – that should come up with the Windows Command prompt.
When it displays that Command window, type pbt and press return and see what happens. If the path is fine then you will get a load of text with various instructions.

If you just get an error then you will need to alter an environment variable (PATH).

Press Start menu and type PATH. It will offer you to edit system environment variables.
You need to add something like:

C:\Users\*your windows user name*\AppData\Local\Programs\Python\Python38-32\Scripts

…to the end of the PATH variable.
That’s because PBT.exe is stored in that scripts folder.

That should fix your issue.
Рекомендации по теме
Комментарии
Автор

Thanks a lot used it to successfully kick start a pycharm based python exe as intended

BhajansAshwin
Автор

Very good vedio, thank you very much.

SmallCatandDog
Автор

I can't seem to find the flow up video you mentioned at the end of the video. I'm very interested in seeing how you integrate the qt designer created checkbox through code rather than making a line saying addcheckbox.

Firefenex
Автор

How to add new modules to the plugin template created with Plugin Builder 3?

aloestudante
Автор

qgs widgets missing in my qt designer, do you know what is problem

aleksandarbundalo