CompassView.qml Example File
compass/assets/CompassView.qml
import bb.cascades 1.0
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
layout: DockLayout {
}
ImageView {
id: compFace
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredHeight: 700
preferredWidth: 700
imageSource: "asset:///images/FACE-512.png"
}
ImageView {
id: needle
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredHeight: compFace.preferredHeight * 0.93
preferredWidth: compFace.preferredWidth * 0.93
scalingMethod: ScalingMethod.AspectFit
imageSource: "asset:///images/ARROW-Bright.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredHeight: 560
preferredWidth: 580
bottomPadding: 10
layout: DockLayout {
}
Label {
verticalAlignment: VerticalAlignment.Top
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("North")
textStyle {
fontSize: FontSize.Large
}
}
Label {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Left
rotationZ: -90
text: qsTr("West")
textStyle {
fontSize: FontSize.Large
}
}
Label {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Right
rotationZ: 90
text: qsTr("East")
textStyle {
fontSize: FontSize.Large
}
}
Label {
verticalAlignment: VerticalAlignment.Bottom
horizontalAlignment: HorizontalAlignment.Center
scaleY: -1
scaleX: -1
text: qsTr("South")
textStyle {
fontSize: FontSize.Large
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredHeight: 470
preferredWidth: 470
bottomPadding: 10
layout: DockLayout {
}
rotationZ: 45
Label {
verticalAlignment: VerticalAlignment.Top
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("NE")
textStyle {
fontSize: FontSize.XSmall
}
}
Label {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Left
rotationZ: -90
text: qsTr("NW")
textStyle {
fontSize: FontSize.XSmall
}
}
Label {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Right
rotationZ: 90
text: qsTr("SE")
textStyle {
fontSize: FontSize.XSmall
}
}
Label {
verticalAlignment: VerticalAlignment.Bottom
horizontalAlignment: HorizontalAlignment.Center
scaleY: -1
scaleX: -1
text: qsTr("SW")
textStyle {
fontSize: FontSize.XSmall
}
}
}
}