Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-958

QQmlListProperty unavailable

XMLWordPrintable

    • All

      QQmlListProperty is a very important type for types exposed to qml. It is the only way I know to allow declaration of multiple child in a parent:

       

      MyClass
      {
          MyChild{}
          MyChild{}
          ....
      }

      Currently I found a workaround: expose MyClass as MyClass_ with a 'QVariantList' property and create a MyClass.qml type with a qqmllistproperty, but it is a PITA:

       

      import QtQuick 2.5
      import ...
      
      MyClass_
      {    
          default property list<MyChild> childs_;    
      
          childs:
          {
              var l = [];
              for (var i = 0; i < childs_.length; i++)
                  l.push(childs_[i]);
              return l;
          }
      }
      

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

            crmaurei Cristian Maureira-Fredes
            maxlem Maxime Lemonnier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes