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

qmlsc/qmlcachegen should be able to handle QList<registered object type>

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.6
    • 6.5
    • QML: Compiler, QML: Tooling
    • None

    Description

      Currently we automatically register QList<T> if T is a value type, and QQmlListProperty<T> if T is an object type.

      However, the engine also happily handles QList of object types. qmllint and qmlsc/qmlcachegen should arguably not warn about them (which they do for the attached project, though qmllint only does so if warnings are enabled).

      A workaround is to do

      struct Helper
      {
          Q_GADGET
          QML_FOREIGN(QList<DataObject *>)
          QML_ANONYMOUS
          QML_SEQUENTIAL_CONTAINER(DataObject *)
      };
      

      but that should most likely not be necessary.

      Attachments

        1. objectList.7z
          2 kB
          Fabian Kosmale

        Activity

          People

            qtqmlteam Qt Qml Team User
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: