Doc: Add information about running Qt for Python applications

Change-Id: Ibd9ed61bd1f771c8081f2c2d2fcc492f0a87da11
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This commit is contained in:
Leena Miettinen
2019-04-03 13:29:19 +02:00
parent b8e5a609e1
commit 903da92051
6 changed files with 85 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -58,6 +58,10 @@
select the \uicontrol Options link, or select \uicontrol Tools > select the \uicontrol Options link, or select \uicontrol Tools >
\uicontrol Options > \uicontrol Kits. \uicontrol Options > \uicontrol Kits.
Qt for Python projects rely on the \l{Using Language Servers}
{experimental language server client} for code completion,
highlighting, and other useful features.
If \QC cannot find an existing build for a particular \l{glossary-buildandrun-kit}{kit}, If \QC cannot find an existing build for a particular \l{glossary-buildandrun-kit}{kit},
it starts out it starts out
from a clean slate, and creates new debug and release build configurations from a clean slate, and creates new debug and release build configurations
@@ -79,8 +83,8 @@
\li Select \uicontrol File > \uicontrol {Open File or Project} \li Select \uicontrol File > \uicontrol {Open File or Project}
(\key Ctrl+O or \key Cmd+O on \macos) and select the project file (\key Ctrl+O or \key Cmd+O on \macos) and select the project file
for the project to open: \e {.pro} (qmake), \e {CMakeLists.txt} for the project to open: \e {.pro} (qmake), \e {CMakeLists.txt}
(CMake), \e {.qbs} (Qbs), or \e {Makefile.am} (Autotools, (CMake), \e {.qbs} (Qbs), \e {pyproject} (Python), or
experimental). \e {Makefile.am} (Autotools, experimental).
\li In the \uicontrol {Configure Project} tab, select kits for building and running your \li In the \uicontrol {Configure Project} tab, select kits for building and running your
project, and click \uicontrol {Configure Project}. project, and click \uicontrol {Configure Project}.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -117,4 +117,6 @@
\image qmldesigner-run-custom-exe.png "Run settings for custom executables" \image qmldesigner-run-custom-exe.png "Run settings for custom executables"
\include qtquick/creator-projects-settings-run-qtquick.qdocinc run settings qt quick ui \include qtquick/creator-projects-settings-run-qtquick.qdocinc run settings qt quick ui
\include python/creator-python-run.qdocinc run settings python
*/ */

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -85,5 +85,6 @@
\if defined(qtcreator) \if defined(qtcreator)
\include qnx/creator-projects-running-qnx.qdocinc running on qnx \include qnx/creator-projects-running-qnx.qdocinc running on qnx
\include python/creator-python-run.qdocinc running python
\endif \endif
*/ */

View File

@@ -0,0 +1,73 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
//! [running python]
\section1 Running Python Projects
You can execute Qt for Python applications directly from \QC. If you
used the \l{Creating Qt for Python Applications}{new project wizard}
to create the application project, the \c main.py file is automatically
executed when you select the \uicontrol Run button.
You can specify another file to execute in the
\l{Specifying Run Settings for Python Projects}{run settings}
of the project.
//! [running python]
//! [run settings python]
\section1 Specifying Run Settings for Python Projects
You can specify settings for running Qt for Python applications:
\image qtcreator-python-run-settings.png
\list
\li In the \uicontrol Interpreter field, specify the path to the
Python executable.
\li In the \uicontrol Script field, you can see the path to the
main file of the project that will be run.
\li In the \uicontrol {Command line arguments} field, specify
command line arguments to be passed to the executable.
\endlist
If you want to run some other Python file than \c main.py, create a custom
executable run configuration:
\image qtcreator-python-run-settings-custom-executable.png
\list 1
\li Select \uicontrol Add > \uicontrol {Custom Executable}.
\li In the \uicontrol Executable field, specify the path to the
Python executable.
\li In the \uicontrol {Command line arguments} field, select
the Python file to run.
\endlist
//! [run settings python]
*/