main.qml Example File
sqlwidgetmapper/assets/main.qml
import bb.cascades 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 20
rightPadding: 20
topPadding: 20
bottomPadding: 20
Container {
horizontalAlignment: HorizontalAlignment.Fill
bottomPadding: 20
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
verticalAlignment: VerticalAlignment.Center
preferredWidth: 200
text: qsTr ("First Name")
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
}
}
TextField {
objectName: "firstNameField"
verticalAlignment: VerticalAlignment.Center
leftMargin: 10
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
textStyle {
base: SystemDefaults.TextStyles.SmallText
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
bottomPadding: 20
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
verticalAlignment: VerticalAlignment.Center
preferredWidth: 200
text: qsTr ("Last Name")
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
}
}
TextField {
objectName: "lastNameField"
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
textStyle {
base: SystemDefaults.TextStyles.SmallText
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
bottomPadding: 20
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
verticalAlignment: VerticalAlignment.Center
preferredWidth: 200
text: qsTr ("Quote")
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
}
}
TextArea {
objectName: "quoteField"
verticalAlignment: VerticalAlignment.Center
preferredHeight: 350
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
textStyle {
base: SystemDefaults.TextStyles.SmallText
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Button {
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
text: qsTr ("Previous")
onClicked: _dataMapper.toPrevious ()
enabled: _dataMapper.currentIndex != 0
}
Label {
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
text: qsTr ("%1/%2").arg(_dataMapper.currentIndex + 1).arg(_dataMapper.count)
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
textAlign: TextAlign.Center
}
}
Button {
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
text: qsTr ("Next")
onClicked: _dataMapper.toNext ()
enabled: (_dataMapper.currentIndex < (_dataMapper.count - 1))
}
}
}
}
}