Hi, using the latest pyside2 from PyPi (version 5.12). I fail to use the
decorator syntax with PySide2:

The following works:

-----------------------------------------------------------
from PySide2.QtCore import Signal, Property, Slot, QObject, QTimer
class Foo(QObject):
    def __init__(self, parent=None):
        super(Foo, self).__init__(parent)

    autoUpdateChanged = Signal()
    def autoUpdate_(self):
        return self._autoUpdate

    def autoUpdate__(self, d):
        if self._autoUpdate != d:
            self._autoUpdate = d
            self.autoUpdateChanged.emit()

    autoUpdate = Property(bool, autoUpdate_, autoUpdate__, notify =
autoUpdateChanged)


The following fails with Cannot assign to non-existent property
"autoUpdate" :

------------------------------------------------------------------------------------
from PySide2.QtCore import Signal, Property, Slot, QObject, QTimer
class Foo(QObject):
    def __init__(self, parent=None):
        super(Foo, self).__init__(parent)

    autoUpdateChanged = Signal()
    @Property(bool, notify = autoUpdateChanged)
    def autoUpdate(self):
        return self._autoUpdate

    @autoUpdate.setter
    def autoUpdate(self, d):
        if self._autoUpdate != d:
            self._autoUpdate = d
            self.autoUpdateChanged.emit()



--------------------------

Am-I missusing the syntax? I googled for more than one hour in search for a
similar issue before posting here.

Thank you
_______________________________________________
PySide mailing list
[email protected]
https://lists.qt-project.org/listinfo/pyside

Reply via email to