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

Could not create a QML sequence object for a registered gadget/value type

    XMLWordPrintable

Details

    Description

      Assigning to a pure QML list property of a custom registered gadget/value type fails:

      Could not create a QML sequence object for QList<KScreen::OsdAction>
      

      The type is registered as follow:

      qmlRegisterType<OsdAction>("org.kde.KScreen", 1, 0, "osdAction");
      

      and the property is defined as you'd expect it:

      property list<osdAction> actions
      

      Assignment can be done from C++ or from another var property in QML — the result is the same:

      rootObject->setProperty("actions", QVariant::fromValue(OsdAction::availableActions()));
      

      where availableActions returns a QList as described in the error message above.


      Meanwhile, a singular property works just fine:

          property osdAction action
      
          onActionChanged: {
              print("Action", action); // prints members
          }
      
      
      rootObject->setProperty("action", QVariant::fromValue(OsdAction::availableActions().first()));
      

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            ratijas ivan tkachenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes