Unsolved Develop a PySide application in QtCreator
-
Hi,
I'd like to develop a PySide application in QtCreator but I'm not sure if it is a good idea or not. In the end I'd like to have a standalone tool. I found out that the best possibility is currently probably using fbs. But it seems to me it can not be really integrated in QtCreator.
What would you suggest? Currently I do the GUI in QtCreator and then separately write the Python code and run it using fbs. Is there a better solution? Are there any plans for the future? Thank you.
-
@vlada
Latest project I am working on uses Qt Creator just for UI, shell script forpyuic
export, and VSCode for Python/PySide2 development. Cannot comment on how that compares to your integrated solution, but it works.Meanwhile, I looked at your fbs. Have you noted:
You can use fbs for free in open source projects that are licensed under the GPL. If you don't want to open your code up to the public, you can purchase a commercial license for EUR 449 per developer:
Note that GPL, instead of LGPL, requires you to publish your own source code. Just saying.
-
@JonB Thank you, I haven't noticed that part about GPL. I probably wouldn't have a problem with GPL since I only plan to share the app with my colleagues and they can have the source code.
But it would be better to have a solution where I don't have to comply with GPL. Have you tried cx_freeze or py2exe? Last time I tried them, they didn't work with PySide 2.
-
Nope, but this will need looking into in due course. Doesn't
windeployqt
/linuxdeployqt
work for us with PySide2? There must be a best answer for this? Folks on this forum probably know, if they see this.EDIT Maybe not. From 4 years ago someone was saying
I've never used windeployqt before, but I have deployed some PyQt and PySide apps to Windows before.
My usual setup is to use py2exe or cx_Freeze. There is a weird bug with PyQt4 and py2exe, so I'd recommend cx_Freeze as that's what I've switched over to now. Also cx_Freeze's support of bdist_msi is awesome and takes a huge amount of the deployment worries away!
EDIT 2
OK, what's this: https://doc.qt.io/qtforpython/deployment-pyinstaller.html ? New? Official looking?Ahh, we both need to start reading from https://doc.qt.io/qtforpython/deployment.html, have you seen that?
-
@JonB This is great. The documentation must be pretty new. I don't remember seeing it before and I really searched for it. I will study it and hopefully I will find a well working solution.
@Denni-0 Thanks a lot for your suggestions. I already found out that using QtCreator for Python is not a good solution (at least yet). I like using it for multiplatform C++ applications.
Currently my workflow is following:
- Design simple UI in the Designer, if it had to be more complicated, I will definitely use a different approach (like I do for my other apps)
- Compile resources to Python code
- Write the rest of the code in a Python IDE (I prefer PyScripter)
- "Compile" the code
Regarding the step 4), I'm not sure, what is the best solution (cx_freeze, py2exe, PyInstaller). I'm not sure if I can use fbs because of it's license. So I won't rather rely on it.
What would you suggest as the best method to create a standalone application? In the old days of first PySide based on Qt4 I used py2exe, but it seems it is not actively developed anymore.
-
@Denni-0 I agree with you. I never used the Designer until now. I just wanted to give it a try and see myself if it makes sense to use it or not. For a very simple UI, I would say yes, but as soon as you need to extend your application, it will be a blocker.