diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2024-01-06 01:59:49 +0100 |
---|---|---|
committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2024-01-08 13:05:30 +0100 |
commit | 2ff4524802b90be37c10662593b5060af86d338f (patch) | |
tree | 15386f9ffaeb296b6b447bb5a88e97aced04e458 | |
parent | 09ce3bf16a6b624034986e07399f487a5eafa396 (diff) |
doc: fix some issues found with rstcheck
Checking the local rst files, we had some issues
related to repeated links, bad syntax of code-blocks,
invalid levels, etc.
Pick-to: 6.6
Change-Id: I94d64d9cca5142833640f30299d1ad32b568f7ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
31 files changed, 172 insertions, 145 deletions
diff --git a/sources/pyside6/doc/developer/documentation.rst b/sources/pyside6/doc/developer/documentation.rst index 1ebfc18c5..517bd46f1 100644 --- a/sources/pyside6/doc/developer/documentation.rst +++ b/sources/pyside6/doc/developer/documentation.rst @@ -69,4 +69,5 @@ There are 2 scripts used for determining the inheritance: * ``json_inheritance.py`` (env var ``INHERITANCE_FILE``) reads a inheritance.json file containing the class hierarchy generated by shiboken's doc generator. + * ``import_inheritance.py`` actually tries to import the class (legacy) diff --git a/sources/pyside6/doc/developer/feature-motivation.rst b/sources/pyside6/doc/developer/feature-motivation.rst index ea0cede51..1509ea724 100644 --- a/sources/pyside6/doc/developer/feature-motivation.rst +++ b/sources/pyside6/doc/developer/feature-motivation.rst @@ -286,7 +286,7 @@ When using ``__feature__`` often with common IDEs, you may want to provide a feature-aware version of ``.pyi`` files to get a correct display. The simplest way to change them all in-place is the command: -.. code-block:: python +.. code-block:: bash pyside6-genpyi all --feature snake_case true_property diff --git a/sources/pyside6/doc/developer/signature_doc.rst b/sources/pyside6/doc/developer/signature_doc.rst index c81e9a559..a6c703dab 100644 --- a/sources/pyside6/doc/developer/signature_doc.rst +++ b/sources/pyside6/doc/developer/signature_doc.rst @@ -318,7 +318,7 @@ A shortcut for this command is ``pyside6-genpyi``. A useful command to change all .pyi files to use all features is -.. code-block:: python +.. code-block:: bash pyside6-genpyi all --feature snake_case true_property diff --git a/sources/pyside6/doc/extras/QtBluetooth.rst b/sources/pyside6/doc/extras/QtBluetooth.rst index dda05f20b..965896752 100644 --- a/sources/pyside6/doc/extras/QtBluetooth.rst +++ b/sources/pyside6/doc/extras/QtBluetooth.rst @@ -56,7 +56,7 @@ the environment variable ``QT_EVENT_DISPATCHER_CORE_FOUNDATION=1`` to circumvent this issue. Applications that don't use Classic Bluetooth will find a subset of -`QtBluetooth <https://doc.qt.io/qt-6/qtbluetooth-module.html>`_ is available, +`QtBluetooth`_ is available, as CoreBluetooth (Bluetooth LE) do not require either of :class:`QApplication<PySide6.QtWidgets.QApplication>` or :class:`QGuiApplication<PySide6.QtGui.QGuiApplication>` . @@ -71,32 +71,32 @@ Guides Logging Categories ^^^^^^^^^^^^^^^^^^ -The `QtBluetooth <https://doc.qt.io/qt-6/qtbluetooth-module.html>`_ module +The `QtBluetooth`_ module exports the following :class:`logging categories<~.Configuring Categories>` : - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |Logging Category |Description | - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth |Enables logging of cross platform code path in `QtBluetooth <https://doc.qt.io/qt-6/qtbluetooth-module.html>`_| - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth.android|Enables logging of the Android implementation | - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth.bluez |Enables logging of the BLuez/Linux implementation | - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth.ios |Enables logging of the iOS implementation | - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth.osx |Enables logging of the macOS implementation | - +--------------------+--------------------------------------------------------------------------------------------------------------+ - |qt.bluetooth.windows|Enables logging of the Qt for Windows implementation | - +--------------------+--------------------------------------------------------------------------------------------------------------+ + +--------------------+-------------------------------------------------------------+ + |Logging Category |Description | + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth |Enables logging of cross platform code path in `QtBluetooth`_| + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth.android|Enables logging of the Android implementation | + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth.bluez |Enables logging of the BLuez/Linux implementation | + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth.ios |Enables logging of the iOS implementation | + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth.osx |Enables logging of the macOS implementation | + +--------------------+-------------------------------------------------------------+ + |qt.bluetooth.windows|Enables logging of the Qt for Windows implementation | + +--------------------+-------------------------------------------------------------+ Logging categories can be used to enable additional warning and debug output -for `QtBluetooth <https://doc.qt.io/qt-6/qtbluetooth-module.html>`_ . More -detailed information about logging can be found in +for `QtBluetooth`_ . More detailed information about logging can be found in :class:`QLoggingCategory<~.QLoggingCategory>` . A quick way to enable all -`QtBluetooth <https://doc.qt.io/qt-6/qtbluetooth-module.html>`_ logging is to -add the following line to the ``main()`` function: +`QtBluetooth`_ logging is to add the following line to the ``main()`` +function:: - :: + QLoggingCategory.setFilterRules("qt.bluetooth* = true") - QLoggingCategory.setFilterRules("qt.bluetooth* = true") + +.. _QtBluetooth: https://doc.qt.io/qt-6/qtbluetooth-module.html diff --git a/sources/pyside6/doc/extras/QtCore.ClassInfo.rst b/sources/pyside6/doc/extras/QtCore.ClassInfo.rst index 0cb6d32ed..aa080aa08 100644 --- a/sources/pyside6/doc/extras/QtCore.ClassInfo.rst +++ b/sources/pyside6/doc/extras/QtCore.ClassInfo.rst @@ -22,7 +22,7 @@ value and enabling special characters in the key. Example ------- -:: +.. code-block:: python # Recommended syntax @ClassInfo(Author='PySide Team', URL='http://www.pyside.org') diff --git a/sources/pyside6/doc/extras/QtCore.Property.rst b/sources/pyside6/doc/extras/QtCore.Property.rst index f6f7bd4e7..64567c4bc 100644 --- a/sources/pyside6/doc/extras/QtCore.Property.rst +++ b/sources/pyside6/doc/extras/QtCore.Property.rst @@ -16,7 +16,7 @@ They are equivalent to the ``Q_PROPERTY`` macro in the `Qt Docs`_. Here is an example that illustrates how to use this function: -.. code-block:: +.. code-block:: python :linenos: from PySide6.QtCore import QObject, Property @@ -40,20 +40,20 @@ function: The full options for ``QtCore.Property`` can be found with ``QtCore.Property.__doc__``: -.. code-block:: - - Property(self, type: type, - fget: Optional[Callable] = None, - fset: Optional[Callable] = None, - freset: Optional[Callable] = None, - fdel: Optional[Callable] = None, - doc: str = '', - notify: Optional[Callable] = None, - designable: bool = True, - scriptable: bool = True, - stored: bool = True, user: bool = False, - constant: bool = False, - final: bool = False) -> PySide6.QtCore.Property +.. code-block:: python + + Property(self, type: type, + fget: Optional[Callable] = None, + fset: Optional[Callable] = None, + freset: Optional[Callable] = None, + fdel: Optional[Callable] = None, + doc: str = '', + notify: Optional[Callable] = None, + designable: bool = True, + scriptable: bool = True, + stored: bool = True, user: bool = False, + constant: bool = False, + final: bool = False) -> PySide6.QtCore.Property Normally, only ``type``, ``fget``and ``fset`` are used. @@ -68,16 +68,16 @@ requires a ``type`` parameter. In the above example, the following lines would be equivalent properties: -.. code-block:: +.. code-block:: python - pp = QtCore.Property(int, readPP, setPP) # PySide version - pp = property(readPP, setPP) # Python version + pp = QtCore.Property(int, readPP, setPP) # PySide version + pp = property(readPP, setPP) # Python version As you know from the `Python Docs`_, ``Python`` allows to break the property creation into multiple steps, using the decorator syntax. We can do this in ``PySide`` as well: -.. code-block:: +.. code-block:: python :linenos: from PySide6.QtCore import QObject, Property @@ -110,7 +110,7 @@ If you are using properties of your objects in QML expressions, QML requires that the property changes are notified. Here is an example illustrating how to do this: -.. code-block:: +.. code-block:: python :linenos: from PySide6.QtCore import QObject, Signal, Property diff --git a/sources/pyside6/doc/extras/QtCore.Signal.rst b/sources/pyside6/doc/extras/QtCore.Signal.rst index b50c34148..43dd49216 100644 --- a/sources/pyside6/doc/extras/QtCore.Signal.rst +++ b/sources/pyside6/doc/extras/QtCore.Signal.rst @@ -1,8 +1,8 @@ .. currentmodule:: PySide6.QtCore .. _Signal: -Signal -****** +Qt Signal +********* Synopsis -------- @@ -10,19 +10,19 @@ Synopsis Functions ^^^^^^^^^ -+---------------------------------------------------------------------------------------------+ -|def :meth:`connect<Signal.connect>` (receiver) | -+---------------------------------------------------------------------------------------------+ -|def :meth:`disconnect<Signal.disconnect>` (receiver) | -+---------------------------------------------------------------------------------------------+ -|def :meth:`emit<Signal.disconnect>` (\*args) | -+---------------------------------------------------------------------------------------------+ ++-----------------------------------------------------+ +|def :meth:`connect<Signal.connect>` (receiver) | ++-----------------------------------------------------+ +|def :meth:`disconnect<Signal.disconnect>` (receiver) | ++-----------------------------------------------------+ +|def :meth:`emit<Signal.disconnect>` (\*args) | ++-----------------------------------------------------+ Detailed Description -------------------- - The :class:`~.Signal` class provides a way to declare and connect Qt - signals in a pythonic way. +The :class:`~.Signal` class provides a way to declare and connect Qt +signals in a pythonic way. .. class:: PySide6.QtCore.Signal([type1 [, type2...]] [, name="" [, arguments=[]]]) diff --git a/sources/pyside6/doc/extras/QtCore.Slot.rst b/sources/pyside6/doc/extras/QtCore.Slot.rst index c62104369..06646e33c 100644 --- a/sources/pyside6/doc/extras/QtCore.Slot.rst +++ b/sources/pyside6/doc/extras/QtCore.Slot.rst @@ -1,8 +1,8 @@ .. currentmodule:: PySide6.QtCore .. _Slot: -Slot -**** +Qt Slots +******** Detailed Description -------------------- diff --git a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerContainerExtension.rst b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerContainerExtension.rst index 1baa9e369..5280e5e22 100644 --- a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerContainerExtension.rst +++ b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerContainerExtension.rst @@ -5,6 +5,8 @@ QPyDesignerContainerExtension ***************************** QPyDesignerContainerExtension is the base class for implementing -`QDesignerContainerExtension <https://doc.qt.io/qt-6/qdesignercontainerextension.html>`_ +`QDesignerContainerExtension class`_ for a Qt Designer custom widget plugin in Python. It provides the required inheritance from **QObject**. + +.. _QDesignerContainerExtension class: https://doc.qt.io/qt-6/qdesignercontainerextension.html diff --git a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst index 00260860b..71ef6cd69 100644 --- a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst +++ b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst @@ -19,20 +19,20 @@ Functions Detailed Description -------------------- - The :class:`~.QPyDesignerCustomWidgetCollection` implements - `QDesignerCustomWidgetCollectionInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetcollectioninterface.html>`_ - and provides static helper functions for registering custom widgets by - type or by implementing - `QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ . +The :class:`~.QPyDesignerCustomWidgetCollection` implements +`QDesignerCustomWidgetCollectionInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetcollectioninterface.html>`_ +and provides static helper functions for registering custom widgets by +type or by implementing +`QDesignerCustomWidgetInterface`_ . - The usage is explained in :ref:`designer_custom_widgets`. +The usage is explained in :ref:`designer_custom_widgets`. .. py:staticmethod:: QPyDesignerCustomWidgetCollection.registerCustomWidget(type[, xml=""[, tool_tip=""[, icon=""[, group=""[container=False]]]]]) Registers an instance of a Python-implemented QWidget by type with Qt Designer. The optional keyword arguments correspond to the getters of - `QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ : + `QDesignerCustomWidgetInterface`_ : :param str xml: A snippet of XML code in ``.ui`` format that specifies how the widget is created and sets initial property values. :param str tool_tip: Tool tip to be shown in the widget box. @@ -46,7 +46,9 @@ Detailed Description .. py:staticmethod:: QPyDesignerCustomWidgetCollection.addCustomWidget(custom_widget) Adds a custom widget (implementation of - `QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_) + `QDesignerCustomWidgetInterface`_) with Qt Designer. :param QDesignerCustomWidgetInterface custom_widget: Custom widget instance + +.. _QDesignerCustomWidgetInterface: https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html diff --git a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerMemberSheetExtension.rst b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerMemberSheetExtension.rst index c52aafdf5..997da1480 100644 --- a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerMemberSheetExtension.rst +++ b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerMemberSheetExtension.rst @@ -5,6 +5,8 @@ QPyDesignerMemberSheetExtension ******************************* QPyDesignerMemberSheetExtension is the base class for implementing -`QDesignerMemberSheetExtension <https://doc.qt.io/qt-6/qdesignermembersheetextension.html>`_ +`QDesignerMemberSheetExtension class`_ for a Qt Designer custom widget plugin in Python. It provides the required inheritance from **QObject**. + +.. _QDesignerMemberSheetExtension class: https://doc.qt.io/qt-6/qdesignermembersheetextension.html diff --git a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerTaskMenuExtension.rst b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerTaskMenuExtension.rst index 004c94693..84d19c544 100644 --- a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerTaskMenuExtension.rst +++ b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerTaskMenuExtension.rst @@ -5,6 +5,8 @@ QPyDesignerTaskMenuExtension **************************** QPyDesignerTaskMenuExtension is the base class for implementing -`QDesignerTaskMenuExtension <https://doc.qt.io/qt-6/qdesignertaskmenuextension.html>`_ +`QDesignerTaskMenuExtension class`_ for a Qt Designer custom widget plugin in Python. It provides the required inheritance from **QObject**. + +.. _QDesignerTaskMenuExtension class: https://doc.qt.io/qt-6/qdesignertaskmenuextension.html diff --git a/sources/pyside6/doc/extras/QtMultimedia.rst b/sources/pyside6/doc/extras/QtMultimedia.rst index f495ddc4e..527c2427b 100644 --- a/sources/pyside6/doc/extras/QtMultimedia.rst +++ b/sources/pyside6/doc/extras/QtMultimedia.rst @@ -29,7 +29,7 @@ directive: import PySide6.QtMultimedia -The module also provides `QML types <https://doc.qt.io/qt-6/qtmultimedia-qmlmodule.html>`_ . +The module also provides QML `types <https://doc.qt.io/qt-6/qtmultimedia-qmlmodule.html>`_ . Overviews and Important Topics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -46,27 +46,38 @@ QML Types The following table outlines some important QML types. - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |Type |Description | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`MediaPlayer <https://doc.qt.io/qt-6/qml-qtmultimedia-mediaplayer.html>`_ |Add audio/video playback functionality to a scene. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`CaptureSession <https://doc.qt.io/qt-6/qml-qtmultimedia-capturesession.html>`_|Create a session for capturing audio/video. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`Camera <https://doc.qt.io/qt-6/qml-qtmultimedia-camera.html>`_ |Access a camera connected to the system. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`AudioInput <https://doc.qt.io/qt-6/qml-qtmultimedia-audioinput.html>`_ |Access an audio input (microphone) connected to the system. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`AudioOutput <https://doc.qt.io/qt-6/qml-qtmultimedia-audiooutput.html>`_ |Access an audio output (speaker, headphone) connected to the system. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`VideoOutput <https://doc.qt.io/qt-6/qml-qtmultimedia-videooutput.html>`_ |Display video content. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`MediaRecorder <https://doc.qt.io/qt-6/qml-qtmultimedia-mediarecorder.html>`_ |Record audio/video from the `CaptureSession <https://doc.qt.io/qt-6/qml-qtmultimedia-capturesession.html>`_ . | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`ImageCapture <https://doc.qt.io/qt-6/qml-qtmultimedia-imagecapture.html>`_ |Capture still images from the Camera. | - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - |`Video <https://doc.qt.io/qt-6/qml-qtmultimedia-video.html>`_ |Add Video playback functionality to a scene. Uses `MediaPlayer <https://doc.qt.io/qt-6/qml-qtmultimedia-mediaplayer.html>`_ and `VideoOutput <https://doc.qt.io/qt-6/qml-qtmultimedia-videooutput.html>`_ types to provide video playback functionality.| - +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+---------------------------------------------------------------------+ + |Type |Description | + +------------------+---------------------------------------------------------------------+ + |`MediaPlayer`_ |Add audio/video playback functionality to a scene. | + +------------------+---------------------------------------------------------------------+ + |`CaptureSession`_ |Create a session for capturing audio/video. | + +------------------+---------------------------------------------------------------------+ + |`Camera`_ |Access a camera connected to the system. | + +------------------+---------------------------------------------------------------------+ + |`AudioInput`_ |Access an audio input (microphone) connected to the system. | + +------------------+---------------------------------------------------------------------+ + |`AudioOutput`_ |Access an audio output (speaker, headphone) connected to the system. | + +------------------+---------------------------------------------------------------------+ + |`VideoOutput`_ |Display video content. | + +------------------+---------------------------------------------------------------------+ + |`MediaRecorder`_ |Record audio/video from the `CaptureSession`_ . | + +------------------+---------------------------------------------------------------------+ + |`ImageCapture`_ |Capture still images from the Camera. | + +------------------+---------------------------------------------------------------------+ + |`Video`_ |Add Video playback functionality to a scene. Uses `MediaPlayer`_ and | + | |`VideoOutput`_ types to provide video playback functionality. | + +------------------+---------------------------------------------------------------------+ + +.. _MediaPlayer: https://doc.qt.io/qt-6/qml-qtmultimedia-mediaplayer.html +.. _CaptureSession: https://doc.qt.io/qt-6/qml-qtmultimedia-capturesession.html +.. _Camera: https://doc.qt.io/qt-6/qml-qtmultimedia-camera.html +.. _AudioInput: https://doc.qt.io/qt-6/qml-qtmultimedia-audioinput.html +.. _AudioOutput: https://doc.qt.io/qt-6/qml-qtmultimedia-audiooutput.html +.. _VideoOutput: https://doc.qt.io/qt-6/qml-qtmultimedia-videooutput.html +.. _MediaRecorder: https://doc.qt.io/qt-6/qml-qtmultimedia-mediarecorder.html +.. _ImageCapture: https://doc.qt.io/qt-6/qml-qtmultimedia-imagecapture.html +.. _Video: https://doc.qt.io/qt-6/qml-qtmultimedia-video.html C++ Classes ^^^^^^^^^^^ diff --git a/sources/pyside6/doc/extras/QtQml.QPyQmlParserStatus.rst b/sources/pyside6/doc/extras/QtQml.QPyQmlParserStatus.rst index 58f609b03..f027885af 100644 --- a/sources/pyside6/doc/extras/QtQml.QPyQmlParserStatus.rst +++ b/sources/pyside6/doc/extras/QtQml.QPyQmlParserStatus.rst @@ -5,6 +5,8 @@ QPyQmlParserStatus ****************** QPyQmlParserStatus is the base class for implementing -`QQmlParserStatus <https://doc.qt.io/qt-6/qqmlparserstatus.html>`_ +`QQmlParserStatus class`_ . It provides the required inheritance from **QObject**. + +.. _QQmlParserStatus class: https://doc.qt.io/qt-6/qqmlparserstatus.html diff --git a/sources/pyside6/doc/extras/QtQml.QPyQmlPropertyValueSource.rst b/sources/pyside6/doc/extras/QtQml.QPyQmlPropertyValueSource.rst index 576b8baa0..fea238827 100644 --- a/sources/pyside6/doc/extras/QtQml.QPyQmlPropertyValueSource.rst +++ b/sources/pyside6/doc/extras/QtQml.QPyQmlPropertyValueSource.rst @@ -5,6 +5,8 @@ QPyQmlPropertyValueSource ************************* QPyQmlPropertyValueSource is the base class for implementing -`QQmlPropertyValueSource <https://doc.qt.io/qt-6/qqmlpropertyvaluesource.html>`_ +`QQmlPropertyValueSource class`_ . It provides the required inheritance from **QObject**. + +.. _QQmlPropertyValueSource class: https://doc.qt.io/qt-6/qqmlpropertyvaluesource.html diff --git a/sources/pyside6/doc/extras/QtQml.QmlSingleton.rst b/sources/pyside6/doc/extras/QtQml.QmlSingleton.rst index 92cd2e8be..3a05a6ac8 100644 --- a/sources/pyside6/doc/extras/QtQml.QmlSingleton.rst +++ b/sources/pyside6/doc/extras/QtQml.QmlSingleton.rst @@ -1,8 +1,8 @@ .. currentmodule:: PySide6.QtQml .. _QmlSingleton: -QmlSingleton -************ +QmlSingleton decorator +********************** .. py:decorator:: QmlSingleton @@ -20,7 +20,7 @@ constructor. @QmlElement @QmlSingleton class ClassForQml(QObject): - # ... + ... It is also possible to use a static ``create()`` method which receives the engine as a parameter: @@ -33,6 +33,6 @@ the engine as a parameter: @staticmethod def create(engine): - # ... + ... .. note:: The order of the decorators matters; ``QmlSingleton`` needs to be preceded by ``QmlElement``. diff --git a/sources/pyside6/doc/extras/QtQml.QmlUncreatable.rst b/sources/pyside6/doc/extras/QtQml.QmlUncreatable.rst index 72fde741d..46c7c49de 100644 --- a/sources/pyside6/doc/extras/QtQml.QmlUncreatable.rst +++ b/sources/pyside6/doc/extras/QtQml.QmlUncreatable.rst @@ -26,6 +26,6 @@ Passing None or no argument will cause a standard message to be used instead. @QmlElement @QmlUncreatable("BaseClassForQml is an abstract base class") class BaseClassForQml(QObject): - # ... + ... .. note:: The order of the decorators matters; ``QmlUncreatable`` needs to be preceded by ``QmlElement``. diff --git a/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst b/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst index 8a8c4bef0..48879d263 100644 --- a/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst +++ b/sources/pyside6/doc/extras/QtUiTools.loadUiType.rst @@ -1,5 +1,4 @@ .. currentmodule:: PySide6.QtUiTools -.. _loadUiType: loadUiType *********** diff --git a/sources/pyside6/doc/faq/typesoffiles.rst b/sources/pyside6/doc/faq/typesoffiles.rst index 71d38f809..d3bd4512d 100644 --- a/sources/pyside6/doc/faq/typesoffiles.rst +++ b/sources/pyside6/doc/faq/typesoffiles.rst @@ -58,7 +58,6 @@ XML. Here is an extract of the beginning of a ``.ui`` file: <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> - ... The `pyside6-uic` tool generates Python code from these `.ui` files, which you can import from your main files, so it is not necessary diff --git a/sources/pyside6/doc/faq/whatisshiboken.rst b/sources/pyside6/doc/faq/whatisshiboken.rst index e867fadd4..bf6d19ab3 100644 --- a/sources/pyside6/doc/faq/whatisshiboken.rst +++ b/sources/pyside6/doc/faq/whatisshiboken.rst @@ -4,11 +4,9 @@ Binding Generation: What Is Shiboken? ===================================== When you install ``PySide6`` you might have notice that also ``Shiboken6`` -is installed as a dependency: +is installed as a dependency:: -.. code-block:: bash - - (env) [qt ~]$ pip install pyside6 + $ pip install pyside6 Collecting pyside6 Downloading PySide6-6.0.0-6.0.0-cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl (170.5 MB) |████████████████████████████████| 170.5 MB 42 kB/s diff --git a/sources/pyside6/doc/gettingstarted/porting_from2.rst b/sources/pyside6/doc/gettingstarted/porting_from2.rst index 07f5b48c6..6699f54e0 100644 --- a/sources/pyside6/doc/gettingstarted/porting_from2.rst +++ b/sources/pyside6/doc/gettingstarted/porting_from2.rst @@ -36,14 +36,14 @@ import statements: .. code-block:: python - from PySide2.QtWidgets import QApplication... + from PySide2.QtWidgets import QApplication from PySide2 import QtCore needs to be changed to: .. code-block:: python - from PySide6.QtWidgets import QApplication... + from PySide6.QtWidgets import QApplication from PySide6 import QtCore diff --git a/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst index 2221858bc..c5464640b 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst @@ -60,7 +60,8 @@ signal to the `say_hello()` function: button.clicked.connect(say_hello) Finally, we show the button and start the Qt main loop: -:: + +.. code-block:: python # Show the button button.show() @@ -68,9 +69,8 @@ Finally, we show the button and start the Qt main loop: app.exec() Here is the complete code for this example: -:: - #!/usr/bin/python +.. code-block:: python import sys from PySide6.QtWidgets import QApplication, QPushButton diff --git a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst index e2512f9db..b7712672b 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst @@ -105,7 +105,8 @@ Complete code ------------- Here is the complete code for this tutorial: -:: + +.. code-block:: python import sys from PySide6.QtWidgets import (QLineEdit, QPushButton, QApplication, diff --git a/sources/pyside6/doc/tutorials/basictutorial/translations.rst b/sources/pyside6/doc/tutorials/basictutorial/translations.rst index e4f06f437..ae44838e1 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/translations.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/translations.rst @@ -9,7 +9,7 @@ Translating Applications Qt Linguist ----------- -`Qt Linguist <https://doc.qt.io/qt-6/qtlinguist-index.html>`_ and +`Qt Linguist`_ and its related tools can be used to provide translations for applications. The ``examples/widgets/linguist`` example illustrates this. The example is @@ -98,10 +98,12 @@ The example can then be run in German: LANG=de python main.py +.. _Qt Linguist: https://doc.qt.io/qt-6/qtlinguist-index.html + GNU gettext ----------- -The `GNU gettext <https://docs.python.org/3/library/gettext.html>`_ module +The `GNU gettext`_ module can be used to provide translations for applications. The ``examples/widgets/gettext`` example illustrates this. The example is @@ -119,7 +121,7 @@ Those functions are defined at the top: .. code-block:: python import gettext - ... + # ... _ = None ngettext = None @@ -212,3 +214,5 @@ The example can then be run in German: .. code-block:: bash LANG=de python main.py + +.. _GNU gettext: https://docs.python.org/3/library/gettext.html diff --git a/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst b/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst index b286de507..f431cb5c4 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst @@ -11,14 +11,14 @@ information in trees. You can also create a data model and display it using a further on. To know more about the Model/View architecture in Qt, refer to its `official documentation <https://doc.qt.io/qt-6/model-view-programming.html>`_. -1. Import ``QTreeWidget`` and ``QTreeWidgetItem`` for this application: +#. Import ``QTreeWidget`` and ``QTreeWidgetItem`` for this application: .. code-block:: python import sys from PySide6.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem -2. Define a dictionary with project structures to display the information as a +#. Define a dictionary with project structures to display the information as a tree, with files belonging to each project: .. code-block:: python @@ -27,13 +27,13 @@ information in trees. You can also create a data model and display it using a "Project B": ["file_b.csv", "photo.jpg"], "Project C": []} -3. Initialize the ``QApplication`` singleton: +#. Initialize the ``QApplication`` singleton: .. code-block:: python app = QApplication() -4. Configure the ``QTreeWidget`` to have two columns, one for the item name, +#. Configure the ``QTreeWidget`` to have two columns, one for the item name, and the other for item type information of the files in the project directories. You can set the column name with the ``setHeaderLabels`` as described below: @@ -44,7 +44,7 @@ information in trees. You can also create a data model and display it using a tree.setColumnCount(2) tree.setHeaderLabels(["Name", "Type"]) -5. Iterate the data structure, create the ``QTreeWidgetItem`` elements, and add +#. Iterate the data structure, create the ``QTreeWidgetItem`` elements, and add the corresponding children to each parent. We also extract the extension name for only the files and add them into the second column. @@ -64,7 +64,7 @@ information in trees. You can also create a data model and display it using a tree.insertTopLevelItems(0, items) -7. Show the tree and execute the ``QApplication``. +#. Show the tree and execute the ``QApplication``. .. code-block:: python diff --git a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst index aedaf2d60..c56593ee4 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst @@ -192,7 +192,7 @@ The complete code of this example looks like this: Then to execute it we just need to run the following on a command prompt: -.. code-block:: python +.. code-block:: bash python main.py @@ -214,7 +214,7 @@ in the widget box and can be dragged onto the form just like Qt's widgets (see `Using Custom Widgets with Qt Designer <https://doc.qt.io/qt-6/designer-using-custom-widgets.html>`_ ). Normally, this requires implementing the widget as a plugin to Qt Designer written in C++ implementing its -`QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ . +`QDesignerCustomWidgetInterface`_ . Qt for Python provides a simple interface for this which is similar to :meth:`registerCustomWidget()<PySide6.QtUiTools.QUiLoader.registerCustomWidget>`. @@ -262,10 +262,10 @@ The code of the registration script looks as follows: QPyDesignerCustomWidgetCollection provides an implementation of -`QDesignerCustomWidgetCollectionInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetcollectioninterface.html>`_ +`QDesignerCustomWidgetCollectionInterface`_ exposing custom widgets to **Qt Designer** with static convenience functions for registering types or adding instances of -`QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ . +`QDesignerCustomWidgetInterface`_ . The function :meth:`registerCustomWidget()<PySide6.QtDesigner.QPyDesignerCustomWidgetCollection.registerCustomWidget>` @@ -273,7 +273,7 @@ is used to register a widget type with **Qt Designer**. In the simple case, it can be used like ``QUiLoader.registerCustomWidget()``. It takes the custom widget type and some optional keyword arguments passing values that correspond to the getters of -`QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ : +`QDesignerCustomWidgetInterface`_ : When launching **Qt Designer** via its launcher ``pyside6-designer``, the custom widget should be visible in the widget box. @@ -286,6 +286,9 @@ is registered for the custom widget. The example is a port of the corresponding C++ `Task Menu Extension Example <https://doc.qt.io/qt-6/qtdesigner-taskmenuextension-example.html>`_ . +.. _QDesignerCustomWidgetCollectionInterface: https://doc.qt.io/qt-6/qdesignercustomwidgetcollectioninterface.html +.. _QDesignerCustomWidgetInterface: https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html + Troubleshooting the Qt Designer Plugin ++++++++++++++++++++++++++++++++++++++ diff --git a/sources/pyside6/doc/tutorials/expenses/expenses.rst b/sources/pyside6/doc/tutorials/expenses/expenses.rst index c674a6116..2064488ae 100644 --- a/sources/pyside6/doc/tutorials/expenses/expenses.rst +++ b/sources/pyside6/doc/tutorials/expenses/expenses.rst @@ -33,10 +33,10 @@ code block. .. code-block:: python :linenos: - if __name__ == "__main__": - app = QApplication([]) - # ... - sys.exit(app.exec()) + if __name__ == "__main__": + app = QApplication([]) + # ... + sys.exit(app.exec()) Now, to start the development, create an empty window called `MainWindow`. You could do that by defining a class that inherits from `QMainWindow`. diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst index 2a3bd7079..87fb97660 100644 --- a/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst +++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst @@ -26,7 +26,7 @@ the tables. Port these helper functions first. Here is how the C++ and Python versions of these functions look like: C++ version ------------- +----------- .. literalinclude:: initdb.h :language: c++ @@ -34,7 +34,7 @@ C++ version :lines: 9-33 Python version ---------------- +-------------- .. literalinclude:: createdb.py :language: python @@ -45,16 +45,16 @@ Now that the helper functions are in place, port ``initDb``. Here is how the C++ and Python versions of this function looks like: -C++ version ------------- +C++ version (initDb) +-------------------- .. literalinclude:: initdb.h :language: c++ :linenos: :lines: 35-112 -Python version ---------------- +Python version (init_db) +------------------------ .. literalinclude:: createdb.py :language: python @@ -77,7 +77,7 @@ test it, add the following code to ``main.py`` and run it: Use the following command from the prompt to run: -.. code-block:: +.. code-block:: bash python main.py diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst index fa6ef1116..83ba3357b 100644 --- a/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst +++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst @@ -47,16 +47,16 @@ For example, painting stars to represent the rating for each book in the table. Here is how the reimplemented code looks like: -C++ version ------------- +C++ version (bookdelegate) +-------------------------- .. literalinclude:: bookdelegate.cpp :language: c++ :linenos: :lines: 22- -Python version ---------------- +Python version (bookdelegate) +----------------------------- .. literalinclude:: bookdelegate.py :language: python diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst index 59ce6c9f1..98d4d3982 100644 --- a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst +++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst @@ -21,9 +21,9 @@ and add the following imports to it: To generate this Python code, run the following command on the prompt: -.. code-block:: +.. code-block:: bash - pyside6-uic bookwindow.ui -o ui_bookwindow.py + pyside6-uic bookwindow.ui -o ui_bookwindow.py Try porting the remaining code now. To begin with, here is how both the versions of the constructor code looks: @@ -101,9 +101,9 @@ image only. Now, run the ``pyside6-rcc`` tool on the ``books.qrc`` file to generate ``rc_books.py``. -.. code-block:: +.. code-block:: bash - pyside6-rcc books.qrc -o rc_books.py + pyside6-rcc books.qrc -o rc_books.py Once you have the Python script generated, make the following changes to ``bookdelegate.py`` and ``main.py``: diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst b/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst index c664f2e46..eee3f807e 100644 --- a/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst +++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/qmlsqlintegration.rst @@ -144,7 +144,6 @@ remaining space that is left after accommodating the Pane. .. _attached properties: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html .. _Layout.fillWidth: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#fillWidth-attached-prop .. _Layout.fillHeight: https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#fillHeight-attached-prop -.. _ListView: https://doc.qt.io/qt-5/qml-qtquick-listview.html .. _Qt Quick QML Types: https://doc.qt.io/qt-5/qtquick-qmlmodule.html Let's look at the ``Listview`` in detail: |