Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.15.0
-
None
Description
I am trying to set the data of a `QStandardItem`. The datatype of the data prior to the assignment is a subclass of `list`. If I try to access the object afterwards the datatype has changed to `list`.
According to the documentation a reference should be stored and that's also what I would expect in PySide2.
However, it looks like `setData` is trying to copy the object instead of storing a reference.
The behaviour only affects subclasses of list. Subclasses of dict/set/tuple work fine.
from PySide2 import QtGui class Q(list): pass item = QtGui.QStandardItem() obj = Q() type(obj) # <class '_main_.Q'> item.setData(obj) type(item.data()) # <class 'list'>