Important: Please read the Qt Code of Conduct -

Visual Development of GUI possible with pyside

  • I would like to use Qt Creator to build my GUI and then pyside for coding.

    All the example I can find use QML, which I don't believe you can build WYSIWYG in Qt Creator.

    Is there a tutorial to WYSIWYG build a form and then code it up in python using pyside?


  • I'm not sure whether tutorials for that currently exist (please create one if you have time and interest!), but creating the forms in Qt Creator is quite simple. Just design the form in Qt Creator (or Qt Designer, for that matter) and save the .ui file. Then, run pyside-uic:

    pyside-uic -o myform.ui

    Then, you import the created python file, subclass it in your program, and be done with it. The whole process is pretty well detailed in Mark Summerfield's PyQt book, which is also applicable to PySide (with minor differences).

    However, it's also possible to design QML UIs in Qt Creator: the plugin just might not be enabled by default in older Qt Creator versions. For example, I just downloaded Qt Creator 2.0.1 to doublecheck these instructions, and there you need to enable the QML designer plugin at Help -> About Plugins (no, not the most obvious place in the world, I agree). After restarting, the "Design" button at the left toolbar is enabled and can be used to create QML UIs. These you can just save and use right away in your Python programs.

    Qt Creator (at least the recent versions) already has support for Python code highlighting, so it's also possible to edit Python code there directly. No support for Python projects exists at the moment, though.

  • Hi,

    I tried installing PySide on my machine (win7 64 bits, using Python 2.7 64 bits) and I got this message:

    @ > easy_install PySide

    error: Setup script exited with error: You need the program "nmake" on your system path to compile PySide.@

    What's that "nmake" program?

  • Consistent with what @mairas says, there's a tutorial that shows you how to do this:

    Using QtCreator, PySide and PySide Tools
    You can also create the GUI in QtCreator and convert it to a python script. Follow this tutorial:

  • @ericparent, your post seems to be unrelated to the OP's discussion, but have you tried to install the windows binaries?

    Go here and click on "Get PySide":

Log in to reply