diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-03-03 00:18:21 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-03-03 01:13:04 (GMT) |
commit | e1d1b65e63223e8705b8df09645f8740ab7fb80d (patch) | |
tree | ac75f7a68d7ad7c051e8313bf009775083ae55f5 /tests/auto/declarative | |
parent | 585ddb51909db49c51e9e8019d3b5d45c48a1a08 (diff) | |
download | Qt-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/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 4 |
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); } } |