main.qml Example File
repeater/assets/main.qml
import bb.cascades 1.0
import Components 1.0
TabbedPane {
Tab {
title: qsTr ("Simple")
Page {
CustomPage {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
Repeater {
model: 5
Label {
text: qsTr ("Hello World")
textStyle {
base: SystemDefaults.TextStyles.BodyText
color: Color.White
}
}
}
}
}
}
}
Tab {
title: qsTr ("Index")
Page {
CustomPage {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
Repeater {
model: 5
Label {
text: qsTr ("Hello World (%1)").arg(index)
textStyle {
base: SystemDefaults.TextStyles.BodyText
color: Color.White
}
}
}
}
}
}
}
Tab {
title: qsTr ("Dynamic")
Page {
CustomPage {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
Slider {
id: slider
fromValue: 1
toValue: 5
value: 1
}
Repeater {
model: slider.immediateValue
Label {
text: qsTr ("Hello World (%1)").arg(index)
textStyle {
base: SystemDefaults.TextStyles.BodyText
color: Color.White
}
}
}
}
}
}
}
Tab {
title: qsTr ("Array")
Page {
CustomPage {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
Repeater {
model: [Color.Red, Color.Yellow, Color.Green, Color.Blue, Color.White]
Label {
text: qsTr ("Hello World (%1)").arg(index)
textStyle {
base: SystemDefaults.TextStyles.BodyText
color: modelData
}
}
}
}
}
}
}
Tab {
title: qsTr ("SQL Model")
Page {
CustomPage {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
Container {
Repeater {
model: _sqlModel
Container {
topPadding: 30
Label {
text: title
textStyle.base: SystemDefaults.TextStyles.TitleText
textStyle.color: Color.White
}
Label {
text: qsTr ("[%1 %2]").arg(firstname).arg(surname)
textStyle.base: SystemDefaults.TextStyles.BodyText
textStyle.color: Color.White
}
Divider {}
}
}
}
}
}
}
}
}
}