Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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 for pyuic 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?


  • Banned

    Okay I would like to put a shout out here -- Do no use the Qt Creator -- as I believe (and I could be wrong) it creates that same kind of end result that the Designer does -- a black-box untouchable problematic code base

    And let me clarify just being a black-box code base makes it problematic unto-itself let alone the other issues that drop into the mix.

    Further it is just as easy or easier along with being a whole lot more effective to program the GUI as it was meant to be programmed and that is not using some automated process that creates code you cannot easily understand nor tweak and adjust as needed.

    If you need to see how to do this check me out on this forum (if possible) as I have posted a few examples of how to take these black-box code bases and convert them into proper Qt code -- otherwise if you cannot check me out -- and need help on this just ask or drop by my free Discord Python-PyQt classroom and we can help you more interactively with this



  • @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:

    1. 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)
    2. Compile resources to Python code
    3. Write the rest of the code in a Python IDE (I prefer PyScripter)
    4. "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.


  • Banned

    Yes I am currently aware that there are issues creating an executable from the current python3-qt5 (be it PySide2 or PyQt5) however I have not gotten to this point myself in my major code but it is an issue that I am aware of -- and that I know there are solid solutions out there for -- which I will research again and implement come that time

    However I think I have a few students (who i might consult when I get there) that I believe have already struggled through and successfully created standalone exes so its doable

    As for simple UIs and the Designer -- again I can create a simple UI using straight Qt (PySide2 or PyQt5) just as quickly as you can with the Designer but my end result is that I have code that I understand what it is doing and that I can tweak however I like in order to expand its functionality should I need or desire to -- as it is not an untouchable nearly undecipherable bit of black-box code so you ought to give it a whirl I know that everyone so far that I have taught how to do this has dropped the Designer entirely as they concur it is simply not necessary and ultimately harder and more time consuming to use



  • @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.


Log in to reply