Exporting a Qt Design Studio project for Python development

  1. Create a project with Qt Design Studio 4.5 or above. Then open your Qt Design Studio project with Qt Design Studio 4.6 or above.

    Note: You cannot export a project created with Qt Design Studio 4.4 or an earlier version of Qt Design Studio for Python development.

  2. Go to File > Export Project > Enable Python Generator. This creates a Python folder in your project folder. You can find the main.py file in the Python folder. This file is necessary for working in Python.

    Note: Do not modify the contents of the autogen folder inside the Python folder manually; they are overwritten with each change you make in the project.

    {Exporting a Qt Design Studio project to Python.}

Opening the Qt Design Studio project with Python

When your project has the Python folder and the main.py file, you can set up your Python environment for developing with Qt Design Studio projects.

{The generated Python folder in the Qt Design Studio project.}

{The generated Python file in the Qt Design Studio project.}

  1. Install Python.

    Note: You need Python version between 3.8 and 3.13 to install PySide6.

    Download Python from https://www.python.org/downloads/.

  2. Install PySide6. For installation instructions, see Getting started with Qt for Python.
  3. Install the Qt Design Studio packages for PySide6. Stay in the virtual environment that was accessed for installing PySide6. From there, execute the following command in the command prompt.
    pip install PySide6_DS
  4. Go to your project folder in the command prompt.
    cd <path/to/your/project/folder>
  5. Run the following command to open the main.py file from your project.
    python Python\main.py

    Note: Any extra data or Python files you add to the project and, import from main.py must remain inside the Python folder.

Your Qt Design Studio project now runs in Python. Use Python to add more functionalities to the project. Go to Qt for Python to learn more about developing Qt projects using Python.

Available under certain Qt licenses.
Find out more.