aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/gettingstarted/package_details.rst
blob: 8551cdcd652373720d555b2637e20961f4605412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
.. _package_details:

Package Details
===============

Having a large project as the Qt Framework available from one simple
installation line::

    pip install pyside6

is really beneficial,
but it might be confusing to newcomers.

Besides your IDE, you don't need to install anything else to develop your
Qt application, because the same command installs many tools
that will help you design UIs, use QML types, generate
files automatically, translate applications, etc.

Package Dependencies
--------------------

.. image:: packages.png
   :width: 400
   :alt: Packages structure and dependency

Starting from 6.3.0, the ``pyside6`` package (wheel) is almost empty,
and only includes references to other packages that are required
to properly use all the modules.
This packages are:

* ``pyside6-essentials``, `essential Qt modules <https://pypi.org/project/PySide6-Essentials/>`_,
* ``pyside6-addons``, `additional Qt modules <https://pypi.org/project/PySide6-Addons/>`_,
* ``shiboken6``, a utility Python module.

You can verify this by running ``pip list`` to check the installed
packages in your Python (virtual) environment::

  (env) % pip list
  Package            Version
  ------------------ -------
  pip                22.0.4
  PySide6            6.3.0
  PySide6-Addons     6.3.0
  PySide6-Essentials 6.3.0
  setuptools         58.1.0
  shiboken6          6.3.0

Both ``pyside6-essentials`` and ``pyside6-addons`` contain Qt binaries
(``.so``, ``.dll``, or ``.dylib``) that are used by the Python wrappers
that enable you to use the Qt modules from Python.
For example, in the ``QtCore`` module, you will find
on Linux:

* ``PySide6/QtCore.abi3.so``, and
* ``PySide6/Qt/lib/libQt6Core.so.6``

inside the ``site-packages`` directory of your (virtual) environment.
The first is the *importable* module which depends on the second file
which is the original QtCore library.

.. note:: The package ``shiboken6-generator`` is not a dependency,
   and it's not available on PyPi. The reason, is that it depends on
   ``libclang``, which is a large library that we don't package, and
   requires a special configuration for you to use. Check the `Shiboken
   Documentation`_ for more details.

..
  Adding the full URL because it's a different sphinx project.
.. _`Shiboken Documentation`: https://doc.qt.io/qtforpython/shiboken6/gettingstarted.html

.. _package_tools:

Tools Included
--------------

Following the same idea from the modules, we also include in the packages
(wheels) Qt tools that are important for any Qt application development
workflow, like ``uic``, ``rcc``, etc.

All the tools **must** be used from the PySide wrappers, and not directly.
For example, if exploring the ``site-packages/`` directory on your installation
you find ``uic.exe`` (on Windows), you should not click on that, and use
``pyside6-uic.exe`` instead.
The reason for this is the proper setup of PATHs, plugins, and more,
to properly work with the installed Python package.

Here you can find all the tools we include in |project| starting
from 6.3.0, grouped by different topics:

Project development
~~~~~~~~~~~~~~~~~~~

.. grid:: 2
    :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
~~~~~~~~~~~~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-designer``
        :link: pyside6-designer
        :link-type: ref

        drag-and-drop tool for designing Widget UIs (generates ``.ui`` files,
        see :ref:`using_ui_files`).

    .. grid-item-card:: ``pyside6-uic``
        :link: pyside6-uic
        :link-type: ref

        to generate Python code from ``.ui`` form files.

    .. grid-item-card:: ``pyside6-rcc``
        :link: pyside6-rcc
        :link-type: ref

        to generate serialized data from ``.qrc`` resources files.
        Keep in mind these files can be used in other non-widget projects.


QML Development
~~~~~~~~~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-qmllint``
        :link: pyside6-qmllint
        :link-type: ref

        that verifies the syntactic validity of QML files.

    .. grid-item-card:: ``pyside6-qmlregistrar``
        :link: pyside6-qmlregistrar
        :link-type: ref

        to read metatypes files and generate files that contain the necessary
        code to register all the types marked with relevant macros.

    .. grid-item-card:: ``pyside6-qmlimportscanner``
        :link: pyside6-qmlimportscanner
        :link-type: ref

        to identify the QML modules imported from a
        project/QML files and dump the result as a JSON array.

    .. grid-item-card:: ``pyside6-qmlcachegen``
        :link: pyside6-qmlcachegen
        :link-type: ref

        to compile QML to bytecode at compile time for bundling inside the
        binary.

    .. grid-item-card:: ``pyside6-qml``
        :link: qml-chapter6-plugins-example
        :link-type: ref

        to enable quick prototyping with QML files. This tool mimics the capabilities of Qt's
        ``qml`` runtime utility by directly invoking QQmlEngine/QQuickView. For usage, see
        :ref:`qml-chapter6-plugins-example`.

Translations
~~~~~~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-linguist``
        :link: pyside6-linguist
        :link-type: ref

        for translating text in applications (see :ref:`translations`).

    .. grid-item-card:: ``pyside6-lrelease``
        :link: pyside6-lrelease
        :link-type: ref

        to create run-time translation files for the application.

    .. grid-item-card:: ``pyside6-lupdate``
        :link: pyside6-lupdate
        :link-type: ref

        to synchronize source code and translations.

Qt Help
~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-assistant``
        :link: pyside6-assistant
        :link-type: ref

        for viewing online documentation in Qt Help file format.
        Read more about the formats on the `QtHelp Framework`_ page.

.. _`QtHelp Framework`: https://doc.qt.io/qt-6/qthelp-framework.html

PySide Utilities
~~~~~~~~~~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-genpyi``
        :link: pyside6-genpyi
        :link-type: ref

        to generate Python stubs (``.pyi`` files) for Qt modules.

    .. grid-item-card:: ``pyside6-metaobjectdump``
        :link: pyside6-metaobjectdump
        :link-type: ref

        a tool to print out the metatype information in JSON to be used as
        input for ``qmltyperegistrar``.

Deployment
~~~~~~~~~~

.. grid:: 2
    :gutter: 3 3 4 5

    .. grid-item-card:: ``pyside6-deploy``
        :link: pyside6-deploy
        :link-type: ref

        to deploy PySide6 applications to desktop platforms - Linux, Windows
        and macOS.

    .. grid-item-card:: ``pyside6-android-deploy``
        :link: pyside6-android-deploy
        :link-type: ref

        to deploy PySide6 application as an Android app targeting different
        Android platforms - aarch64, armv7a, i686, x86_64.