PySide6 Designer Custom Widget Directory Structure
-
wrote on 24 Jul 2024, 12:26 last edited by
I'm trying to structure my custum widgets or plugins in a way such that all the required files are not all in the same directory. QtDesigner sees the TicTacToe custom widget (https://doc.qt.io/qtforpython-6/examples/example_designer_taskmenuextension.html#task-menu-extension-example) when all the files are in the same directory, but it doesn't when I separate them (and of course modify the import paths). Do the files all have to be in the same directory?
-
wrote on 25 Jul 2024, 09:36 last edited by
The solution I found was to add the path to the various other files in the register*.py file. So something like sys.path.append("/path/to/necessary/dirs") so that the python files could be importable.
-
wrote on 21 Aug 2024, 09:03 last edited by
You can also rely on the PYSIDE_DESIGNER_PLUGINS variable to point where the plugin is?
https://doc.qt.io/qtforpython-6/tutorials/basictutorial/uifiles.html#designer-custom-widgets