pythonqt-designerpyqt6pyuic

PyQt6 custom QtDesigner plugins don't compile


I'm using PyQt6 and found this instruction how to add plugins to QtDesigner. It worked fine for me and I can see my custom widgets as expected, however, when I use pyuic6 the compilation of the mainpage (which contains such a custom widget) doesn't succeed.

I suspect the reason is that in the Ui-file of the mainpage, there are custom widgets listed but QtDesigner doesn't resolve the path to the definition of these custom widgets. (pyuic states that custom_widget.findtext("header") return None instead of a str)

MainPage.ui:

<ui>
 ...
 <customwidgets>
  <customwidget>
   <class>CustomWidget</class>
  </customwidget>
 </customwidgets>
 ...
</ui>

So how do I tell pyuic6 to use these plugins?

Currently I'm running pyqt6-tools designer -p ./designer_plugins_dir/ from my venv to launch QtDesigner. Is there a way to pass pyuic also a plugins directory or is there a special location in the filesystem where all plugins must be saved to?


Solution

  • I found the issue. I simply forgot to overwirte the "includeFile()" method which does exactly return a string containing information how pyuic6 should import custom widget.