summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-06-16 12:20:41 +0200
committerAlan Alpert <alan.alpert@nokia.com>2010-06-16 12:20:41 +0200
commit50f4129a2664ed72de899f4477b47f91488c04d9 (patch)
treea1e02b8553dc741124b449121b6e5c3d01e3ae19
parentbc4c5a2d9c5d3841948bc4443f2229d8d6ec0e95 (diff)
downloadqt4-tools-50f4129a2664ed72de899f4477b47f91488c04d9.tar.gz
Minor demo fixes
Found some minor demo issues while testing a TextInput change.
-rw-r--r--demos/declarative/samegame/samegame.qml2
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml9
2 files changed, 7 insertions, 4 deletions
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index 9a721da658..9c4bfa80d1 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -115,6 +115,8 @@ Rectangle {
id: nameInputText
anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
focus: false
+ autoScroll: false
+ maximumLength: 24
onTextChanged: {
var newWidth = nameInputText.width + dialogText.width + 40;
if ( (newWidth > nameInputDialog.width && newWidth < screen.width)
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml
index 69f57c68f3..e863262370 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml
@@ -30,13 +30,14 @@ Item {
y: 5
//Below function implements all scrolling logic
onCursorPositionChanged: {
- if(cursorRect.x < leftMargin - textInp.x){//Cursor went off the front
- textInp.x = leftMargin - Math.max(0, cursorRect.x);
- }else if(cursorRect.x > parent.width - leftMargin - rightMargin - textInp.x){//Cusor went off the end
- textInp.x = leftMargin - Math.max(0, cursorRect.x - (parent.width - leftMargin - rightMargin));
+ if(cursorRectangle.x < leftMargin - textInp.x){//Cursor went off the front
+ textInp.x = leftMargin - Math.max(0, cursorRectangle.x);
+ }else if(cursorRectangle.x > parent.width - leftMargin - rightMargin - textInp.x){//Cusor went off the end
+ textInp.x = leftMargin - Math.max(0, cursorRectangle.x - (parent.width - leftMargin - rightMargin));
}
}
+ autoScroll: false //It is preferable to implement your own scrolling
text:""
horizontalAlignment: TextInput.AlignLeft
font.pixelSize:15