[PyQt] Create qt plugin classes dynamically

Phil Thompson phil at riverbankcomputing.com
Thu May 5 20:20:30 BST 2016


On 4 May 2016, at 8:09 pm, Carl Wolff <carl at wolff-online.nl> wrote:
> 
> Hello,
> 
> I want to runtime create qt designer widget classes and accompanying qt plugin classes depending on some configuration files present in a directory which makes programming custom python plugin code not neccesary any more.
> 
> Is this possible?

It should be. You can use the usual Python ways to create the required QPyDesignerCustomWidgetPlugin types dynamically from the configuration files.

The PyQt designer plugin code imports modules in standard locations then looks in those modules for the required types and creates instances of those types.

All you need to do in that module, when it is imported, is create the types and put them in the module dict so that they can be found later.

Phil


More information about the PyQt mailing list