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

QML_SEQUENTIAL_CONTAINER and QT_QMLCACHEGEN_DIRECT_CALLS are undocumented

XMLWordPrintable

    • All
    • e9155711f (dev), f8091d321 (6.5), 9abd54590 (dev), ebbbe3ce0 (6.5)

      When passing a custom QList to qml:

      typedef QList<QColor> ColorList;
      Q_DECLARE_METATYPE(ColorList)
      
      void main()
      {
       //...
          qRegisterMetaType<ColorList>("ColorList");
      }
      
      class MyClass : QObject
      {
      	QML_ELEMENT
      	Q_PROPERTY(ColorList colors)
      };
      

      then qmlint shows this warning:

      :-1: error: Example.qml:47:28: Type "ColorList" of property "colors" not found. This is likely due to a missing dependency entry or a type not being exposed declaratively.
      

      Replacing "ColorList" with "QVariantList" removes this error but then also the type information (e.g. "QColor") is lost in Qml.

        1. screenshot-1.png
          109 kB
          Harald Meyer
        2. qmlmaptest.zip
          8 kB
          Harald Meyer
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ulherman Ulf Hermann
            Harald Meyer Harald Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes