summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-03-03 00:18:21 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-03-03 01:13:04 (GMT)
commite1d1b65e63223e8705b8df09645f8740ab7fb80d (patch)
treeac75f7a68d7ad7c051e8313bf009775083ae55f5 /tests
parent585ddb51909db49c51e9e8019d3b5d45c48a1a08 (diff)
downloadQt-e1d1b65e63223e8705b8df09645f8740ab7fb80d.zip
Qt-e1d1b65e63223e8705b8df09645f8740ab7fb80d.tar.gz
Qt-e1d1b65e63223e8705b8df09645f8740ab7fb80d.tar.bz2
Compensate for horizontal scroll in TextInput micro focus.
Return the adjusted cursore rectangle rather than the one returned by QLineControl. Change-Id: I343ecdb47ef2ea59519c8d155bbb9917d9c8ce56 Task-number: QTBUG-17864 Reviewed-by: Martin Jones
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 24ce0e4..0320ce2 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -1451,6 +1451,7 @@ void tst_qdeclarativetextinput::cursorRectangle()
QVERIFY(r.left() < textWidth);
QVERIFY(r.right() > textWidth);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
}
// Check the cursor rectangle remains within the input bounding rect when auto scrolling.
@@ -1460,11 +1461,14 @@ void tst_qdeclarativetextinput::cursorRectangle()
for (int i = 6; i < text.length(); ++i) {
input.setCursorPosition(i);
QCOMPARE(r, input.cursorRectangle());
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
}
for (int i = text.length() - 2; i >= 0; --i) {
input.setCursorPosition(i);
+ r = input.cursorRectangle();
QVERIFY(r.right() >= 0);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
}
}