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

QML parser claims syntax error when binding value to a custom list property

    XMLWordPrintable

Details

    Description

      Have the following QML code:

      import QtQuick 2.0
      Rectangle {
      id: r
      property list<QtObject> objs1: r.objs2
      property list<QtObject> objs2: [ Rectangle {} ]
      }

      QML Parser claims that 'r.objs2' is a 'Syntax Error'. On the other hand:

      import QtQuick 2.0
      import mylib 1.1
      // declared in CPP
      MyObject {
      id: r
      // myproperty is a q-property of the CPP class
      // with QQmlListProperty<QObject> type
      myproperty: r.objs2
      property list<QtObject> objs2: [ Rectangle {} ]
      }
      works without any syntax error claimed.

      Expected behavior:
      The first example would work and no 'Syntax Error' is claimed.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              dkaspar David Kaspar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes