Details
-
Suggestion
-
Resolution: Fixed
-
P2: Important
-
6.4.0
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.