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/qdeclarativetextinput | |
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/qdeclarativetextinput')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 5c8b59c..caada13 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -1110,10 +1110,15 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft() QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft); QVERIFY(-textInputPrivate->hscroll < 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 textInput->setText(""); - QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft); - QVERIFY(-textInputPrivate->hscroll < canvas->width()/2); + QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight); + if (QApplication::keyboardInputDirection() == Qt::LeftToRight) + QVERIFY(-textInputPrivate->hscroll < canvas->width()/2); + else + QVERIFY(-textInputPrivate->hscroll > canvas->width()/2); textInput->setHAlign(QDeclarativeTextInput::AlignRight); QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight); QVERIFY(-textInputPrivate->hscroll > canvas->width()/2); |