diff options
Diffstat (limited to 'doc/qtcreator/src/python/creator-python-project.qdocinc')
-rw-r--r-- | doc/qtcreator/src/python/creator-python-project.qdocinc | 49 |
1 files changed, 9 insertions, 40 deletions
diff --git a/doc/qtcreator/src/python/creator-python-project.qdocinc b/doc/qtcreator/src/python/creator-python-project.qdocinc index 0ef6bb2d3f..80887fc978 100644 --- a/doc/qtcreator/src/python/creator-python-project.qdocinc +++ b/doc/qtcreator/src/python/creator-python-project.qdocinc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -6,38 +6,12 @@ \section2 Creating Widget-Based Qt for Python Applications - \l {https://doc.qt.io/qtforpython/index.html}{Qt for Python} enables you - to use Qt 6 API in Python applications. You can use the PySide6 modules - to gain access to individual Qt modules, such as \l {Qt Core}, \l {Qt GUI}, - and \l {Qt Widgets}. - - If you have not installed PySide6, \QC prompts you to install it after - you create the project. Further, it prompts you to install the - \l {Python Language Server}{Python language server} that offers services - such as code completion and annotations. Select \uicontrol Install to install - PySide6 and the language server. - - You can see the current Python interpreter on the \uicontrol Edit mode - toolbar. - - \image qtcreator-python-interpreter-edit-mode.webp {Python interpreter on the Edit mode toolbar} - - To see the available interpreters and change their paths, select - the interpreter, and then select \uicontrol {Manage Python Interpreters}. - Or, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Python > - \uicontrol Interpreters. - - \image qtcreator-python-interpreters.png {Python Interpreters in Preferences} - - You can add and remove interpreters and clean up references to interpreters - that you uninstalled, but that still appear in the list. In addition, you - can set the interpreter to use by default. - The Qt for Python Application wizards generate a \c {.pyproject} file that - lists the files in the Python project and a \c {.py} file that has - some boilerplate code. In addition, the widget-based UI wizard creates a - \c {.ui} file that has a \QD form, and the Qt Quick Application wizard - creates a \c {.qml} file that has Qt Quick controls. + lists the files in the \l{Developing Qt for Python Applications}{Python} + project and a \c {.py} file that has some boilerplate code. In addition, the + widget-based UI wizard creates a \c {.ui} file that has a \QD form, and the + Qt Quick Application wizard creates a \c {.qml} file that imports Qt Quick + controls. The \c{.pyproject} files are JSON-based configuration files that replace the previously used \c {.pyqtc} configuration files. You can still open and @@ -49,7 +23,7 @@ the PySide version, class name, base class, and source file for the class. - \image qtcreator-python-wizard-app-window.png {Qt for Python wizard for creating a widget-based UI} + \image qtcreator-python-wizard-app-window.png {Define Class wizard page} The wizard adds the imports to the source file for access to the QApplication, the base class you selected in the Qt @@ -121,13 +95,8 @@ \endcode You can now modify the boilerplate code in the Edit mode to develop your - Python application. Select \uicontrol REPL on the toolbar to start the - \l{https://pythonprogramminglanguage.com/repl/}{Python interactive shell}. - To start the shell and import the current file as a module, select - \uicontrol {REPL Import File}. To also import all functions from - the file, select \uicontrol {REPL Import *}. - - Always regenerate the Python code after modifying a UI file. + Python application. Always regenerate the Python code after modifying a + UI file. Open the .ui file in the \uicontrol Design mode to create a widget-based UI in \QD. |