What I really meant, is this (probably you want to define the actions
somewhere else):
import QtQuick 2.4
import Ubuntu.Components 1.3
MainView {
width: units.gu(80)
height: units.gu(70)
Action {
id: action1
text: "Action 1"
onTriggered: print("first one")
}
Action {
id: action2
text: "Action 2"
onTriggered: print("second one")
}
Page {
header: PageHeader {
title: "Example"
extension: Sections {
actions: [ action1, action2 ]
selectedIndex: 1
}
}
Button {
anchors.centerIn: parent
text: "Change action name"
onClicked: action1.text = "First action"
}
}
}
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1557707
Title:
[Sections] selectedIndex binding is broken if the model changes
Status in Canonical System Image:
Triaged
Status in ubuntu-ui-toolkit package in Ubuntu:
Incomplete
Bug description:
If I assign a default value for the selectedIndex, it is expected that
the binding for this value will be kept until the user selects a
different section. Changing the model should not affect that, but it
does, as this example shows:
import QtQuick 2.0
import Ubuntu.Components 1.3
MainView {
width: 720
height: 1280
Page {
id: myPage
anchors.fill: parent
title: "Click the page"
header: PageHeader {
id: pageHeader
title: myPage.title
extension: Sections {
id: pageSections
model: [ "one", "two", "three" ]
selectedIndex: 1
}
}
MouseArea {
anchors.fill: parent
onClicked: pageSections.model = [ "first", "second", "third" ]
}
}
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1557707/+subscriptions
--
Mailing list: https://launchpad.net/~touch-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help : https://help.launchpad.net/ListHelp