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

Opaque containers do not work with QML

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P5: Not important
    • 6.8.0
    • 6.5.3
    • PySide
    • None
    • Windows
    • 22fb42c83 (dev)

    Description

      When you pass an opaque container from Python to QML, QML sees it as a PyObject, not as its native Qt type. The attached example results in the following printed to the console:

      <PySide6.QtGui.QPointFList object at 0x0000020A25EEEDB0> [PySide6.QtCore.QPointF(1.000000, 2.000000)]
      qml: QVariant(PySide::PyObjectWrapper, 0x20a25eeedb0) 

      It would be useful if QML saw it as a QList, to make passing data from Python to QML more efficient.

      Attachments

        1. pyside2820_cpp.zip
          1.0 kB
        2. pyside2820_diag.diff
          0.6 kB
        3. pyside2820.py
          0.9 kB
        4. testOpaqueContainerQML.py
          0.4 kB
        For Gerrit Dashboard: PYSIDE-2820
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            matsjoyce-refeyn Matthew Joyce
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes