Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1402

QtCore.Property is out of date

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • 6.5.0, 6.4.3
    • 5.15.3
    • PySide
    • None
    • a754c9f95 (dev), 05958ae2a (dev), ada319277 (6.4), 668f36dfb (6.4)

    Description

      QtCore.Property was developed around 2012 and never really updated.
      Python's property implementation changed 2013 like this:

      class TestClass:
          def __init__(self):
              self._data = None
      
          @property
          def thing(self):
              return self._data
      
          @thing.setter
          def thing(self, value):    # Would not work with another name
              self._data = value
      

      The property implementation was changed so that every changing action on a property
      now creates a full copy of the property object. This has the side effect that properties with
      different setter names no longer work, because the property object would be missed.

      PyQt5 already has an almost correct implementation of QtCore.pyqtProperty, just __doc__ is not writable.

      With the supplied patch, PySide2's property implementation is completely correct, but has one inherent problem left:
      QtCore.Property does work with QObject derived classes, only, while PyQt5
      does not need that. This is a curiosity of our property implementation which does not use the usual tp_descr_get/tp_descr_set slots and therefore needs further investigation.

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-1402
          # Subject Branch Project Status CR V

          Activity

            People

              ctismer Christian Tismer
              ctismer Christian Tismer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews