Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110438

QML_SEQUENTIAL_CONTAINERS and assignment to QML property does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.5.0, 6.5, 6.6.0
    • 6.4.2, 6.5.0 Beta1
    • QML: Compiler
    • None
    • c9b8b0611 (dev), b3f81380b (6.5), 049022370 (6.4), 6d181fc04 (dev), 518509297 (dev), 588f9fc17 (6.5), ddac1d5d6 (6.5)

      As a follow up to QTBUG-110315, I tried to assign the registered type to a property inside QML like

      property list<Entry> entries: Foo.entries

      prints

      qt.core.qobject.connect: QObject::connect(QObject, QQmlDMObjectData): invalid nullptr parameter
      qml: {"0":null}
      qrc:/sandbox/main.qml:31: TypeError: Cannot read property 'status' of null
      

      during runtime and prints

      Error: main.qml:15:46: Could not compile binding for entries: cannot convert from QList<Entry*> of Foo::entries with type QList<Entry*> to QList<QObject *> of QList<QObject *>
      

      plus the complete QML file during compilation.

      Using

      property var entries2: Foo.entries 

      instead works and contains the entries (with the drawback that it does not know what "entries" is, actually.

      We had that list assignment construct in one place only, and it is easily replaceable by the same thing in C++ here. Nevertheless the sequential container behaviour feels a bit inconsistent here.

        1. sandbox.tgz
          2 kB
          Cajus Pollmeier
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: