Pyside6: generate and save Python code automatically in Designer when saving UI
-
wrote on 16 Mar 2024, 09:45 last edited by
I have this working in QtCreator, which is my current universal C++ IDE, but sometimes I use Qt Designer with other tools like VSCode and some people I know uses it, but can't see a way to update automatically the .py generated file from the .ui like QtC does.
Is there some option to automate the process with Qt Designer or is the only way by saving manually from menu Form -> View Python Code and Save?
-
wrote on 17 Mar 2024, 09:24 last edited by
Designer only saves the .ui file. You need to run pyside6-uic to convert that to the .py file.
It seems you didn't read entirely the OP, it does, from the
Form
menu, the only annoying issue is that it's not automatic when saving theui
for obvious reasons.So probably I could make a designer plugin that does it, regardless to the IDE editor used.
There are some limitation in Designer plugins that makes this less useful than the current option. -
I have this working in QtCreator, which is my current universal C++ IDE, but sometimes I use Qt Designer with other tools like VSCode and some people I know uses it, but can't see a way to update automatically the .py generated file from the .ui like QtC does.
Is there some option to automate the process with Qt Designer or is the only way by saving manually from menu Form -> View Python Code and Save?
wrote on 16 Mar 2024, 10:18 last edited by@redtide
Designer only saves the.ui
file. You need to runpyside6-uic
to convert that to the.py
file. Creator does this for you when you "build" or whatever. I don't know how vscode works, but if you can run an OS command like that from there you would be good. -
@redtide
Designer only saves the.ui
file. You need to runpyside6-uic
to convert that to the.py
file. Creator does this for you when you "build" or whatever. I don't know how vscode works, but if you can run an OS command like that from there you would be good. -
wrote on 17 Mar 2024, 09:24 last edited by
Designer only saves the .ui file. You need to run pyside6-uic to convert that to the .py file.
It seems you didn't read entirely the OP, it does, from the
Form
menu, the only annoying issue is that it's not automatic when saving theui
for obvious reasons.So probably I could make a designer plugin that does it, regardless to the IDE editor used.
There are some limitation in Designer plugins that makes this less useful than the current option. -
1/4