Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.14.0
-
None
Description
Porting an older pyside code base to pyside2, having problem with way uic is handling the paths in custom components.
I have a .ui file that I have promoted some generic 'widget' to specific type, and have specified the path to the widget code in Designer, it saves the following code snippit in the .ui file
<customwidgets> <customwidget> <class>MplWidget</class> <extends>QWidget</extends> <header>UI.mplwidget</header> <container>1</container> </customwidget> <customwidget> <class>SeqEditorControl</class> <extends>QWidget</extends> <header>UI.scan.seqeditorcontrol</header> <container>1</container> </customwidget> </customwidgets> <resources/> <connections/>
Then I run pyside2-uic on the ui file it generates the following import statements in the generated python code
import MplWidget import SeqEditorControl
This results in an error at run time because it does not know the module
File "C:\prog\uvspy-pyside2\UI\scan\ui_scanwidget.py", line 18, in <module> import MplWidget ModuleNotFoundError: No module named 'MplWidget'
where as with the older pyside-uic script it would generate
from UI.mplwidget import MplWidget from UI.scan.seqeditorcontrol import SeqEditorControl
Which would include the path that I had entered in the <header> field of the custom widget, and would correctly import the widgets.