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

[qmltc] Extend the usability of the QQmlListProperty generated from the QML list

    XMLWordPrintable

Details

    Description

      When qmltc generates QQmlListProperty from a QML list property the C++ interface isn't very functional. Creating a boiler plate code automatically to append(), clear(), replace(), at(), count() etc. to the QQmlListProperty would greatly improve the usability of the generated C++ class

      For example one would like to be able to do myList.append(new Thingy(&engine)) and for the list to take ownership just as would be expected automatically by QQmlListProperty if writing your own. 

      Additionally, while you can get the length of a list property, it does not generate a proper NOTIFY signal. The Q_OBJECT_BINDABLE_PROPERTY(MyQML, QQmlListProperty<QObject>, m_mylist, &MyQML::mylistChanged) does does something with a generated mylistChanged signal but this does not appear in the Q_PROPERTY declaration making it unbindable from QML.

      Attachments

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

        Activity

          People

            sami.shalayel Sami Shalayel
            tuomas.vaarala Tuomas Vaarala
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes