diff options
Diffstat (limited to 'examples/quick/models/objectlistmodel/objectlistmodel.py')
-rw-r--r-- | examples/quick/models/objectlistmodel/objectlistmodel.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/quick/models/objectlistmodel/objectlistmodel.py b/examples/quick/models/objectlistmodel/objectlistmodel.py index 0843ae480..968761e5c 100644 --- a/examples/quick/models/objectlistmodel/objectlistmodel.py +++ b/examples/quick/models/objectlistmodel/objectlistmodel.py @@ -9,6 +9,7 @@ from PySide6.QtQuick import QQuickView # This example illustrates exposing a list of QObjects as a model in QML + class DataObject(QObject): nameChanged = Signal() @@ -25,7 +26,7 @@ class DataObject(QObject): def setName(self, name): if name != self._name: self._name = name - nameChanged.emit() + self.nameChanged.emit() def color(self): return self._color @@ -33,8 +34,7 @@ class DataObject(QObject): def setColor(self, color): if color != self._color: self._color = color - colorChanged.emit() - + self.colorChanged.emit() name = Property(str, name, setName, notify=nameChanged) color = Property(str, color, setColor, notify=colorChanged) |