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

Exposing C++ lists to QML should be documented better

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.9.0 Beta 2
    • None
    • Documentation
    • None

      It needs to be made more obvious which types can be stored in QQmlListProperty. Specifically, this note should be higher up, probably part of the first sentence:

      Note: QQmlListProperty can only be used for lists of QObject-derived object pointers.

      It should be mentioned that the type passed as the template argument when declaring the QQmlListProperty should not be a pointer to the QObject-derived class, but the plain type.

      The above would probably not be necessary if there was an example of usage beyond the Q_PROPERTY definition in the detailed description. Having this example in the See Also section would also help, although that example doesn't go into the details of providing your own append, etc., functions.

        For Gerrit Dashboard: QTBUG-37888
        # Subject Branch Project Status CR V

            kdpalara Kavindra Palaraja
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes