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

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

    XMLWordPrintable

Details

    Description

       

      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.

       

      Attachments

        1. main.cpp
          1 kB
        2. defaultproperty.pro
          0.0 kB

        Issue Links

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

          Activity

            People

              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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes