aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/extras
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-22 20:37:51 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-24 09:43:58 +0200
commit6b35ebfa04955d83ed26c86d74ef65e9cd29d3a0 (patch)
treea8f3d0b3a6d5d5c9d0dae716aed4c79e7604bf36 /sources/pyside6/doc/extras
parentfc15bf7a133c0ba02851883fc0eb3f41ad37c33a (diff)
Reformat documentation of class Signal
Turn it into a proper class documentation, which can be referenced. Fix the tutorial link. Pick-to: 6.8 Task-number: PYSIDE-2901 Change-Id: Id09946fc8598ccc0eb9658ae1a8a5cbef102a2e5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/doc/extras')
-rw-r--r--sources/pyside6/doc/extras/QtCore.Signal.rst75
1 files changed, 39 insertions, 36 deletions
diff --git a/sources/pyside6/doc/extras/QtCore.Signal.rst b/sources/pyside6/doc/extras/QtCore.Signal.rst
index c83a76a83..fa033120c 100644
--- a/sources/pyside6/doc/extras/QtCore.Signal.rst
+++ b/sources/pyside6/doc/extras/QtCore.Signal.rst
@@ -1,58 +1,61 @@
.. currentmodule:: PySide6.QtCore
+
.. py:class:: Signal
-Synopsis
---------
+ Synopsis
+ --------
+
+ Methods
+ ^^^^^^^
-Functions
-^^^^^^^^^
+ .. container:: function_list
-+-----------------------------------------------------+
-|def :meth:`connect<Signal.connect>` (receiver) |
-+-----------------------------------------------------+
-|def :meth:`disconnect<Signal.disconnect>` (receiver) |
-+-----------------------------------------------------+
-|def :meth:`emit<Signal.disconnect>` (\*args) |
-+-----------------------------------------------------+
+ * def :meth:`connect`
+ * def :meth:`disconnect`
+ * def :meth:`emit`
-Detailed Description
---------------------
+ 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=[]]])
+ .. seealso:: :ref:`tutorial_signals_and_slots`
+
+ .. py:method:: __init__([type1 [, type2...]] [, name="" [, arguments=[]]])
:param name: str
:param arguments: list
-``Signal`` takes a list of Python types of the arguments.
+ ``Signal`` takes a list of Python types of the arguments.
+
+ It is possible to use the same signal name with different types by
+ passing a list of tuples representing the signatures, but this is a legacy
+ technique recommended against in new code (see
+ :ref:`overloading-signals-and-slots`).
- It is possible to use the same signal name with different types by
- passing a list of tuples representing the signatures, but this is a legacy
- technique recommended against in new code (see
- :ref:`overloading-signals-and-slots`).
+ The optional named argument ``name`` defines the signal name. If nothing is
+ passed, the new signal will have the same name as the variable that it is
+ being assigned to.
-The optional named argument ``name`` defines the signal name. If nothing is
-passed, the new signal will have the same name as the variable that it is
-being assigned to.
+ The optional named argument ``arguments`` receives a list of strings
+ denoting the argument names. This is useful for QML applications which
+ may refer to the emitted values by name.
-The optional named argument ``arguments`` receives a list of strings
-denoting the argument names. This is useful for QML applications which
-may refer to the emitted values by name.
+ .. py:method:: connect(receiver[, type=Qt.AutoConnection])
-.. method:: Signal.connect(receiver[, type=Qt.AutoConnection])
+ :param receiver: Python callable, :deco:`Slot` or :class:`Signal`
+ :param type: :class:`~PySide6.QtCore.Qt.ConnectionType`
- Create a connection between this signal and a `receiver`, the `receiver`
- can be a Python callable, a :class:`Slot` or a :class:`Signal`.
+ Create a connection between this signal and a `receiver`.
-.. method:: Signal.disconnect(receiver)
+ .. py:method:: disconnect(receiver)
- Disconnect this signal from a `receiver`, the `receiver` can be a Python
- callable, a :class:`Slot` or a :class:`Signal`.
+ :param receiver: Python callable, :deco:`Slot` or :class:`Signal`
-.. method:: Signal.emit(*args)
+ Disconnect this signal from the `receiver`.
- `args` is the arguments to pass to any connected slots, if any.
+ .. py:method:: emit(*args)
-.. seealso:: :ref:`signals-and-slots`
+ Emits the signal. `args` is the arguments to pass to any connected slots,
+ if any.