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

readonly QtObject properties are not possible

XMLWordPrintable

    • f876562de8eb978cea39fe72e76c49ae51ff2f97 (qtdeclarative)

      readonly properties of type QtObject (or derivative) are not possible. Running the the following example with qmlscene:

      import QtQuick 2.3
      Item {
          readonly property QtObject myProperty: QtObject {
          }
      }
      

      Results in the error:

      file:///tmp/ReadOnlyQtOjbectProperty.qml:3 Expected token `;'
      file:///tmp/ReadOnlyQtOjbectProperty.qml:3 Expected a qualified name id
      

      By simply removing the readonly keyword, the example runs fine.

        1. ReadOnlyQtOjbectProperty.qml
          0.1 kB
          Taylor Braun-Jones
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shausman Simon Hausmann
            nocnokneo Taylor Braun-Jones
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes