diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-24 11:02:03 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-24 11:14:03 +0200 |
| commit | f1fecbc6bc176135fceb90f94c69ae3350f99804 (patch) | |
| tree | bd468281ab5454978480754c3cc661cb8d23b2a8 /sources/pyside6 | |
| parent | adee6ff261780ad549f1e9d0f84f19c435259ae8 (diff) | |
Documentation: Remove mentions of decorator form of signals
Use class variables instead.
Fixes: PYSIDE-2308
Pick-to: 6.5
Change-Id: I4edc07ad2445f05b2db70ca7c1f8e2106177e78b
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/doc/extras/QtCore.Property.rst | 7 | ||||
| -rw-r--r-- | sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sources/pyside6/doc/extras/QtCore.Property.rst b/sources/pyside6/doc/extras/QtCore.Property.rst index 1912b8d23..f6f7bd4e7 100644 --- a/sources/pyside6/doc/extras/QtCore.Property.rst +++ b/sources/pyside6/doc/extras/QtCore.Property.rst @@ -116,6 +116,9 @@ example illustrating how to do this: from PySide6.QtCore import QObject, Signal, Property class Person(QObject): + + name_changed = Signal() + def __init__(self, name): QObject.__init__(self) self._person_name = name @@ -123,10 +126,6 @@ example illustrating how to do this: def _name(self): return self._person_name - @Signal - def name_changed(self): - pass - name = Property(str, _name, notify=name_changed) .. _`Python Docs`: https://docs.python.org/3/library/functions.html?highlight=property#property diff --git a/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py b/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py index e6ecb8d2a..8d732093c 100644 --- a/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py +++ b/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py @@ -15,6 +15,8 @@ QML_IMPORT_MAJOR_VERSION = 1 @QmlSingleton class SchemeManager(QObject): + schemeChanged = Signal() + def __init__(self, parent=None): super().__init__(parent=parent) with open(Path(__file__).parent / "schemes.json", 'r') as f: @@ -34,10 +36,6 @@ class SchemeManager(QObject): def getKeys(self): return self.m_schemes.keys() - @Signal - def schemeChanged(self): - pass - @Property('QStringList', notify=schemeChanged) def currentColors(self): return self.m_schemes[self.m_activeSchemeName].values() |
