Details
Description
PySide2 generates TypeError when use Property decorator with constant=True
TypeError: A constant property cannot have a WRITE method or a NOTIFY signal.
To reproduce - prepare the simple class:
class A(QObject):
def __init__(self):
QObject.__init__(self)
self.val = str("")
when executing python script PySide2 generates TypeError for this code:
@Property(str, constant=True)
def variable(self):
return self.val
However, when we transform the previous code into this:
def getVal(self):
return self.val
variable = Property(str, getVal, constant=True)
It works.
In PySide 5.15.0 it all works fine but for version 5.15.1 and 5.15.2 the decorator example generates TypeError.
Attachments
Issue Links
- is duplicated by
-
PYSIDE-1642 Declaring a Property as constant raises an exception
- Closed
For Gerrit Dashboard: PYSIDE-1426 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
323744,2 | property: fix an eight year olde bug that showed after the overhaul | 5.15 | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
323766,3 | property: fix an eight year olde bug that showed after the overhaul | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |