Python Forum
[PyQt] how to create qt plugins - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [PyQt] how to create qt plugins (/thread-13623.html)



how to create qt plugins - pyuser123 - Oct-24-2018

dear forum members,

I am new to python GUI development. I'd like to make a simple application which I can extend by plugins.

How can I write a plugin in python? I'd prefer to use Qt since I am already familiar with it, just a little. I want to learn about plugin development.

Can you provide some suggestions where to start?

Thank you!


RE: how to create qt plugins - Alfalfa - Oct-24-2018

Are you familiar with python already? You have to learn about modules and class structures, or else the learning curve will be a little steep.

Altough it use no dynamic plugin manager, here is an example of a modular application: https://gitlab.com/william.belanger/obsuite
Notice how the main.py file is short, and all the code is isolated in the plugins.


RE: how to create qt plugins - pyuser123 - Oct-25-2018

Yes, I am familiar with python and basic design pattern concepts. Meanwhile I've found some excellent resources for plugin manager without GUI. I am aiming for a modular GUI application, though it looks like I'll have a look into the fundamentals of plugin manager and GUI applications separately.

Your link is an excellent example, very interesting! :)

(Oct-24-2018, 01:42 PM)Alfalfa Wrote: here is an example of a modular application: https://gitlab.com/william.belanger/obsuite



RE: how to create qt plugins - Alfalfa - Oct-25-2018

Thanks :) I found that as the apps grow bigger, to keep a decent structure the easiest way is to subclass Qt widgets, then to communicate with the main loop by using Qt's signals and slots. That way you can keep the main.py file lean and split your code into modules, so it is much easier to maintain afterward. Refactoring is very tedious so it is a good idea to do it right from the beginning.