diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-06-16 10:20:41 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-06-16 10:20:41 (GMT) |
commit | 50f4129a2664ed72de899f4477b47f91488c04d9 (patch) | |
tree | a1e02b8553dc741124b449121b6e5c3d01e3ae19 /tests | |
parent | bc4c5a2d9c5d3841948bc4443f2229d8d6ec0e95 (diff) | |
download | Qt-50f4129a2664ed72de899f4477b47f91488c04d9.zip Qt-50f4129a2664ed72de899f4477b47f91488c04d9.tar.gz Qt-50f4129a2664ed72de899f4477b47f91488c04d9.tar.bz2 |
Minor demo fixes
Found some minor demo issues while testing a TextInput change.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml index 69f57c6..e863262 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 |