diff options
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/doc/extras/QtCore.Signal.rst | 29 | ||||
| -rw-r--r-- | sources/pyside6/doc/extras/QtCore.Slot.rst | 12 | ||||
| -rw-r--r-- | sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst | 2 |
3 files changed, 39 insertions, 4 deletions
diff --git a/sources/pyside6/doc/extras/QtCore.Signal.rst b/sources/pyside6/doc/extras/QtCore.Signal.rst index 60c611482..2f830d0c4 100644 --- a/sources/pyside6/doc/extras/QtCore.Signal.rst +++ b/sources/pyside6/doc/extras/QtCore.Signal.rst @@ -21,17 +21,38 @@ Functions 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. - PySide adopt PyQt's new signal and slot syntax as-is. The PySide implementation is functionally compatible with the PyQt 4.5 one, with the exceptions listed bellow. +.. class:: PySide6.QtCore.Signal([type1 [, type2...]] [, name="" [, arguments=[]]]) + + :param name: str + :param arguments: list + +``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`). + +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. .. method:: Signal.connect(receiver[, type=Qt.AutoConnection]) - 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`, the `receiver` + can be a Python callable, a :class:`Slot` or a :class:`Signal`. .. method:: Signal.disconnect(receiver) - Disconnect this signal from a `receiver`, the `receiver` can be a Python callable, a :class:`Slot` or a :class:`Signal`. + Disconnect this signal from a `receiver`, the `receiver` can be a Python + callable, a :class:`Slot` or a :class:`Signal`. .. method:: Signal.emit(*args) diff --git a/sources/pyside6/doc/extras/QtCore.Slot.rst b/sources/pyside6/doc/extras/QtCore.Slot.rst index 268cfa4ad..6cc5e8079 100644 --- a/sources/pyside6/doc/extras/QtCore.Slot.rst +++ b/sources/pyside6/doc/extras/QtCore.Slot.rst @@ -22,6 +22,18 @@ Detailed Description QtCore pyqtSlot Slot ======= ======================= ============= + .. class:: PySide6.QtCore.Slot([type1 [, type2...]] [, name="" [, result=None]]) + + :param name: str + :param result: type + + ``Slot`` takes a list of Python types of the arguments. + + The optional named argument ``name`` defines the slot name. If nothing is + passed, the slot name will be the decorated function name. + + The optional named argument ``result`` specifies the return type. + Q_INVOKABLE ----------- diff --git a/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst b/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst index a221e775a..52b79f38d 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst @@ -158,6 +158,8 @@ nothing is passed as name then the new slot will have the same name as the function that is being decorated. +.. _overloading-signals-and-slots: + Overloading Signals and Slots with Different Types -------------------------------------------------- |
