Rectangle{
id: contactBox1
anchors{left: parent.left;leftMargin: 200;top: parent.top;topMargin: 200;bottom: parent.bottom;bottomMargin: 120}
width: 270
clip: true
color: "red"
Image {
id:topArrow
anchors{left: parent.left;leftMargin: parent.width/2-topArrow.width/2}
anchors{top: parent.top }
source: "WheelPickerArrow_Down.png"
visible: northAmericaFlick.contentHeight > northAmericaFlick.height
MouseArea{
anchors.fill: parent
onClicked: {
northAmericaFlick.flick(1,0.2)
}
}
}
Text{
id: northAmericaRegion
anchors{left: parent.left;leftMargin: 20;top: parent.top;topMargin: 20}
text: qsTr("North America:")
font.pixelSize: 26
}
Flickable{
id: northAmericaFlick
x: 20
anchors{top: parent.top;topMargin: 50 }
height: Qt.inputMethod.visible ? parent.height-230 : parent.height-100
width: parent.width
contentWidth: 230
contentHeight: northRegion.contentHeight
flickableDirection: Flickable.VerticalFlick
clip: true
function ensureNAVisible(r){
console.log("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW "+r.x )
console.log("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW "+r.y)
console.log("contentX "+ contentX )
console.log("contentY "+ contentY)
console.log("height "+ r.height)
if (contentX >= r.x)
contentX = r.x;
else if (contentX+width <= r.x+r.width)
contentX = r.x+r.width-width;
// if (contentY >= r.y)
// contentY = r.y;
// else if (contentY+height <= r.y+r.height)
// contentY = r.y+r.height-height;
contentY = r.y
}
TextEdit{
id: northRegion
text: "866-984-3766"
font.pixelSize:24
anchors.fill: parent
width: parent.width-30
color: "#8F8F8F"
clip: true
persistentSelection: true
wrapMode: Text.WrapAnywhere
onCursorRectangleChanged:
{
northAmericaFlick.ensureNAVisible(cursorRectangle)
}
}
}
Image {
id:bottomArrow1
anchors{left: parent.left;leftMargin: parent.width/2-bottomArrow1.width/2}
anchors{bottom: parent.bottom;bottomMargin: 5}
source:"WheelPickerArrow_Up.png"
visible: northAmericaFlick.contentHeight > northAmericaFlick.height
MouseArea{
anchors.fill: parent
onClicked: {
[COLOR="#FF0000"] northAmericaFlick.flick(10,10)[/COLOR] // how do i pass co-ordinates for flick ?
}
}
}
MouseArea{
anchors.fill: parent
propagateComposedEvents: true
onClicked: {
console.log("DDDDDDDDDDDDDDddd")
northRegion.forceActiveFocus()
northRegion.cursorVisible=true
Qt.inputMethod.show()
mouse.accepted=false
}
}
}
InputPanel {
id: inputPanel
z: 1
y: Qt.inputMethod.visible ? parent.height - inputPanel.height : parent.height
anchors.left: parent.left
anchors.right: parent.right
}
Bookmarks