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

default property of QQmlListProperty of class in a namespace doesn't work

XMLWordPrintable

       

      I created a QML element like below and got an error.

      Invalid property assignment: "children" is a read-only property
      namespace Namespace {
      
      class SubObject : public QObject
      {
          Q_OBJECT
      };
      
      class Object : public QObject
      {
          Q_OBJECT
          Q_PROPERTY(QQmlListProperty<SubObject> children READ children)
          Q_CLASSINFO("DefaultProperty", "children")
      ...
      }
      
      

       

      Please build the project attached. It works well when the default property is children1 (QObject) and if you change the default property to children2 (SubObject), it fails.

       

        1. defaultproperty.pro
          0.0 kB
          Tasuku Suzuki
        2. main.cpp
          1 kB
          Tasuku Suzuki
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            tasuku.suzuki Tasuku Suzuki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes