From 78254403931559bf5cfa97e3284f9d42892cc230 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Feb 2024 14:32:17 +0100 Subject: Add documentation on pyside6-project Task-number: PYSIDE-1112 Change-Id: I9b6b01c9dd45440ce0b2832178b11072d33ba06d Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit c2358000248ef49c80699375ecd6ff9091a6d316) Reviewed-by: Adrian Herrmann --- sources/pyside6/doc/contents.rst | 1 + .../pyside6/doc/gettingstarted/package_details.rst | 3 +- sources/pyside6/doc/tools/index.rst | 7 +++ sources/pyside6/doc/tools/pyside-project.rst | 63 ++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 sources/pyside6/doc/tools/index.rst create mode 100644 sources/pyside6/doc/tools/pyside-project.rst diff --git a/sources/pyside6/doc/contents.rst b/sources/pyside6/doc/contents.rst index 04203a53e..4b6c7ffa9 100644 --- a/sources/pyside6/doc/contents.rst +++ b/sources/pyside6/doc/contents.rst @@ -7,6 +7,7 @@ commercial/index.rst gettingstarted/index.rst api.rst + tools/index.rst tutorials/index.rst examples/index.rst videos.rst diff --git a/sources/pyside6/doc/gettingstarted/package_details.rst b/sources/pyside6/doc/gettingstarted/package_details.rst index 40276ae15..5f42a8872 100644 --- a/sources/pyside6/doc/gettingstarted/package_details.rst +++ b/sources/pyside6/doc/gettingstarted/package_details.rst @@ -94,11 +94,12 @@ Project development :gutter: 3 3 4 5 .. grid-item-card:: ``pyside6-project`` + :link: pyside6-project + :link-type: ref to build Qt Designer forms (``.ui`` files), resource files (``.qrc``) and QML type files (``.qmltype``) from a ``.pyproject`` file. - Widget Development ~~~~~~~~~~~~~~~~~~ diff --git a/sources/pyside6/doc/tools/index.rst b/sources/pyside6/doc/tools/index.rst new file mode 100644 index 000000000..68a5d4fc5 --- /dev/null +++ b/sources/pyside6/doc/tools/index.rst @@ -0,0 +1,7 @@ +Tools +===== + +.. toctree:: + :glob: + + pyside-project.rst diff --git a/sources/pyside6/doc/tools/pyside-project.rst b/sources/pyside6/doc/tools/pyside-project.rst new file mode 100644 index 000000000..2a7394065 --- /dev/null +++ b/sources/pyside6/doc/tools/pyside-project.rst @@ -0,0 +1,63 @@ +.. _pyside6-project: + +pyside6-project +=============== + +`pyside6-project` is a command line tool for creating, building and deploying +|project| applications. It operates on a project file which is also used by +`Qt Creator`_. + +Project file format +------------------- + +The project file format is a simple `JSON`_-based format with the suffix +``.pyproject`` listing all files of the project excluding generated files +(typically ``.py``, ``.qml``, ``.qrc``, ``.ts``, or ``.ui`` files): + +.. code-block:: json + + { + "files": ["main.py"] + } + + +Usage +----- + +The tool has several subcommands. New projects can be created using +the below commands, passing the project name (directory): + +*new-ui* + Creates a new QtWidgets project with a Qt Designer-based main window. + +*new-widget* + Creates a new QtWidgets project with a main window. + +*new-quick* + Creates a new QtQuick project. + +The other commands take the project file as an argument. +It is also possible to specify a directory containing the project file. + +*build* + Builds the project, generating the required build artifacts + (see :ref:`using_ui_files`, :ref:`using_qrc_files`). + +*run* + Builds the project and runs the main. + +*deploy* + Deploys the application (see see :ref:`pyside6-deploy`). + +*lupdate* + Updates translation (.ts) files (see :ref:`translations`). + +*clean* + Cleans the build artifacts. + +*qmllint* + Runs the ``qmllint`` tool, checking the QML files. + + +.. _`Qt Creator`: https://www.qt.io/product/development-tools +.. _`JSON`: https://www.json.org/ -- cgit v1.2.3