diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-03-08 04:33:29 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2011-03-08 06:58:11 (GMT) |
commit | 54de06c6f3bd7ef74a10bfab9bff5416078edd6f (patch) | |
tree | 80e49e446f417138bae41750a0b179b4a0e5299c /tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | |
parent | c783cbfe3839d7a4c0f75613d2a94e8cfb7a29d1 (diff) | |
download | Qt-54de06c6f3bd7ef74a10bfab9bff5416078edd6f.zip Qt-54de06c6f3bd7ef74a10bfab9bff5416078edd6f.tar.gz Qt-54de06c6f3bd7ef74a10bfab9bff5416078edd6f.tar.bz2 |
Base empty QML editor horizontal alignment on QApplication::keyboardInputDirection()
Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Change-Id: I240d53c8572fd3d1222b555e93812a3ee38e2558
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 7a0ca12..4d94dae 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -500,10 +500,15 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); - // empty text is also implicitly left aligned + // empty text with implicit alignment follows the system locale-based + // keyboard input direction from QApplication::keyboardInputDirection textEdit->setText(""); - QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft); - QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); + QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight); + if (QApplication::keyboardInputDirection() == Qt::LeftToRight) + QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); + else + QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); textEdit->setHAlign(QDeclarativeTextEdit::AlignRight); QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); |