[tabs] Can't create Tabs from a ListModel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
High
|
Tim Peeters | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Raring |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
It should be possible to "dynamically" create many Tab items inside a Tabs container from a ListModel:
import QtQuick 2.0
import Ubuntu.Components 0.1
MainView {
width: units.gu(20)
height: units.gu(30)
Tabs {
Repeater {
model: 5
}
}
}
}
}
This does not work. The error is: file://
Looking at this, it seems like Tabs internally is looking at its children and complaining because Repeater is not a Tab. That is, it's finding Repeater as a child, rather than "running" the Repeater to generate a bunch of Tab items and then finding the bunch of Tab items as children.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Zsombor Egri: Approve
-
Diff: 483 lines (+236/-83)6 files modifiedmodules/Ubuntu/Components/Tab.qml (+2/-0)
modules/Ubuntu/Components/Tabs.qml (+50/-11)
tests/resources/tabs/MyCustomPage.qml (+50/-0)
tests/resources/tabs/Tabs.qml (+99/-0)
themes/Ambiance/qmltheme/NewTabBar.qml (+30/-19)
themes/Ambiance/qmltheme/NewTabsDelegate.qml (+5/-53)
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Tim Peeters (tpeeters) |
status: | New → Confirmed |
importance: | Undecided → Medium |
summary: |
- Can't create Tabs from a ListModel + [tabs] Can't create Tabs from a ListModel |
Changed in ubuntu-ui-toolkit: | |
importance: | Medium → High |
Changed in ubuntu-ui-toolkit: | |
status: | Confirmed → In Progress |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
I hit this attempting to use a custom item which loads its contents based on a string. Attached is how I tried it, with a string list and modelData.