aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-07-27 14:23:14 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-28 04:34:09 +0200
commit945aba32800d5a22fa01694a81d4dfe2c23e853a (patch)
treeee25949e178b6c5aba5e5ace7cd3cc0b739f8550 /tests
parentae4bc85da09983c7c2ea36a283b6c123223b3287 (diff)
Don't clip the cursor at the far right of a TextInput.
The cursor is allowed to exceed the boundaries of a TextInput so that the text alignment is consistent with the Text element and the bounding rect of TextInput is expanded to allow for that. To avoid clipping the contentSize also needs to be expanded, and the horizontal scrolling should be calculated against the non-expanded size. Task-number: QTBUG-18818 Change-Id: I09e3a7aff9c2e8a333e8a3f9796683563b3e124a Reviewed-on: http://codereview.qt.nokia.com/2242 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
index 497c12f9e1..93e8ad21fd 100644
--- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
+++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
@@ -1745,6 +1745,12 @@ void tst_qsgtextinput::cursorRectangle()
QVERIFY(r.right() >= 0);
QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
}
+
+ input.setText("Hi!");
+ input.setHAlign(QSGTextInput::AlignRight);
+ r = input.cursorRectangle();
+ QVERIFY(r.left() < input.boundingRect().width());
+ QVERIFY(r.right() >= input.width() - error);
}
void tst_qsgtextinput::readOnly()