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

QQmlListProperty unavailable

    XMLWordPrintable

    Details

    • Platform/s:
      All

      Description

      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;
          }
      }
      

        Attachments

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes