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

Cannot have a property that returns a QQmlPropertyMap object - works in PyQt6 though

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 6.2.3
    • PySide
    • None
    • Linux/X11
    • 4118576eda (pyside/pyside-setup/dev) 1cb612c8fc (pyside/pyside-setup/6.2) 6983518e80 (pyside/pyside-setup/6.2.4) 1cb612c8fc (pyside/tqtc-pyside-setup/6.2) 6983518e80 (pyside/tqtc-pyside-setup/6.2.4) 4118576eda (pyside/tqtc-pyside-setup/dev)

    Description

      Create a python QObject derived class with a @Property of type QQmlPropertyMap.

      Register the python class using qmlRegisterType

      In QML, create one of those objects and attempt to reference the property.  Fails with errors:

      QMetaProperty::read: Unable to handle unregistered datatype 'QQmlPropertyMap*' for property 'Car::testmap'
      file:///qtbug5/main.qml:22: TypeError: Cannot read property 'testkey' of undefined

      Simplified minimal repro files attached.

      Same files work fine with PyQt6

       

      Attachments

        1. build.sh
          0.4 kB
        2. main.py
          2 kB
        3. main.qml
          1.0 kB
        4. pyside1845_pyqt.zip
          2 kB
        5. pyside1845.zip
          2 kB
        6. requirements.txt
          0.0 kB
        7. run.sh
          0.1 kB
        For Gerrit Dashboard: PYSIDE-1845
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            johnf John Freeborg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes