Doc: Update the docs about Python development

Task-number: QTCREATORBUG-30209
Change-Id: I3023fb6b9005092ecd76f62774942f366e1bd7d9
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Leena Miettinen
2024-02-21 16:59:07 +01:00
parent a9c2be1071
commit 11c1e071d7
12 changed files with 57 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -18,16 +18,19 @@
\image qtcreator-new-qt-for-python-app-qt-quick-empty-project-ready.webp {A small Qt Quick application}
For more examples of creating Qt for Python applications, see
\l {https://doc.qt.io/qtforpython/tutorials/index.html}
{Qt for Python Examples and Tutorials}.
\section1 Creating an Empty Project
To create a Qt for Python application that has a main QML file:
\list 1
\li Select \uicontrol File > \uicontrol {New Project} >
\uicontrol {Application (Qt for Python)} >
\uicontrol {Qt Quick Application - Empty} > \uicontrol Choose.
The \uicontrol {Project Location} dialog opens.
\li Go to \uicontrol File > \uicontrol {New Project}.
\li Select \uicontrol {Application (Qt for Python)} >
\uicontrol {Qt Quick Application - Empty} > \uicontrol Choose to
open the \uicontrol {Project Location} dialog.
\image qtcreator-new-qt-for-python-app-qt-quick-empty-project-location.webp {Project Location dialog}
\li In \uicontrol {Name}, enter the project name. For example,
\e {hello_world_quick}.
@@ -35,17 +38,14 @@
For example, \c {C:\Qt\examples}.
\li Select \uicontrol{Next} (on Windows and Linux) or \uicontrol Continue
(on \macos) to open the \uicontrol {Define Project Details} dialog.
\image qtcreator-new-qt-for-python-app-qt-quick-empty-project-details.webp {Define Project Details dialog}
\image qtcreator-new-qt-for-python-app-project-details.webp {Define Project Details dialog}
\li In \uicontrol {PySide version}, select the PySide version of
the generated code.
\li In \uicontrol {Interpreter}, select the Python interpreter to use for
the project.
\li Select the \uicontrol {Create new virtual environment} check box to
use a clean \l{https://docs.python.org/3/library/venv.html}{Python}
environment that is independent of your global Python installation.
\li In \uicontrol {Path to virtual environment}, specify the directory
where to create the environment.
\li Select \uicontrol{Next} or \uicontrol Continue.
\li Select \uicontrol{Next} or \uicontrol Continue to open the
\uicontrol {Kit Selection} dialog.
\image qtcreator-new-project-qt-for-python-kit-selection.webp {Selecting a kit for a Python project}
\li Select Qt for Python kits for building, deploying, and running the
project.
\li Review the project settings, and select \uicontrol {Finish} (on
Windows and Linux) or \uicontrol Done (on \macos) to create the
project.
@@ -58,6 +58,8 @@
project.
\li \c {main.py}, which has some boilerplate code.
\li \c {main.qml}, which imports Qt Quick controls.
\li \c {reguirements.txt}, which stores the PySide version of the
generated code.
\endlist
\section1 Adding Qt Quick Imports