[ListItems] Default property being "children" brings some inconvenience
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Medium
|
Unassigned | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
ListItem/Empty.qml defines this property:
default property alias children: body.children
Empty is inherited by Base, and basically means that for all ListItems the default property is "children". This comes a bit as a surprise to a QtQuick developer, because the default property for Item is "data", and not "children".
This fact has the unfortunate effect that it's not possible to freely declare non-graphical objects inside a ListItem. For example:
=========
ListItem.Standard {
property variant accountServiceH
text: accountService.
icon: "image://gicon/" + accountService.
AccountService {
id: accountService
}
}
=========
The above snippet will not work (the QML engine will complain "Cannot assign object to list"), because the AccountService is not a QQuickItem, and the ListItem is trying to assign it to the "children" property.
In order to workaround this the developer can do:
resources: AccountService {...}
but this is rather annoying, especially if the resources are more than one.
I'd propose to double-check if the "default" keyword in the property definition in Empty.qml file is really necessary, and remove it if it isn't.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Zsombor Egri: Approve
-
Diff: 12 lines (+1/-1)1 file modifiedmodules/Ubuntu/Components/ListItems/Empty.qml (+1/-1)
Changed in ubuntu-ui-toolkit: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:ubuntu-ui-toolkit at revision None, scheduled for release in ubuntu-ui-toolkit, milestone february-2014