// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page studio-export-for-python.html
    \previouspage
    \nextpage

    \title Exporting a \QDS project for Python development

        \list 1
            \li \l {Creating a Project} {Create} a project with \QDS 4.5 or above.
                    Then open your \QDS project with \QDS 4.6 or above.

                \note You cannot export a project created with \QDS 4.4 or an
                earlier version of \QDS for Python development.

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

                \note Do not modify the contents of the \c {autogen} folder inside
                    the \c Python folder manually; they are overwritten with each
                    change you make in the project.

            \image studio-project-export-python.webp {Exporting a Qt Design Studio project to Python.}
        \endlist

    \section1 Opening the \QDS project with Python

        When your project has the \c Python folder and the \c {main.py} file, you can set up your
        Python environment for developing with \QDS projects.

        \table
            \row
                \li \image studio-project-export-python-folder.webp {The generated Python folder in the Qt Design Studio project.}
                \li \image studio-project-export-python-file.webp {The generated Python file in the Qt Design Studio project.}
        \endtable
        \list 1
            \li Install Python.

                \note You need Python version between 3.8 and 3.13 to install PySide6.

                Download Python from \l {https://www.python.org/downloads/}.

            \li Install PySide6.
                For installation instructions, see
                \l {https://doc.qt.io/qtforpython-6/quickstart.html}{Getting started with Qt for Python}.

            \li Install the \QDS packages for PySide6. Stay
                in the virtual environment that was accessed for installing
                PySide6. From there, execute the following command in the command prompt.
                \code
                    pip install PySide6_DS
                \endcode

            \li Go to your project folder in the command prompt.
                \code
                    cd <path/to/your/project/folder>
                \endcode

            \li Run the following command to open the \c {main.py} file from your project.
                \code
                    python Python\main.py
                \endcode

                \note Any extra data or Python files you add to the project and,
                    import from \c {main.py} must remain inside the \c {Python} folder.
        \endlist

        Your \QDS project now runs in Python. Use Python to add more
        functionalities to the project. Go to \l {Qt for Python} to learn more
        about developing Qt projects using Python.

*/
