Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.6
-
None
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()));