diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-04-13 17:49:52 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-27 13:47:03 +0200 |
commit | a150d1211f9ec49f963227452ee4818746b8c6ed (patch) | |
tree | 42a0c2d2aa385fd4a558ad98610d0f851244cf7d /tests | |
parent | 63240b55333d602df118f2a540174c8100576fd5 (diff) |
QQuickTextInput aligment to follow input method on neutral content
Earlier input method was followed only on empty editor. This made
inputting one space character with arabic to be visualized left to
right.
As related change arabic numbers are aligned right even though the
flow goes left to right.
Change-Id: I36448949569f6290faad69de14df424575d8b97e
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 27e557bee5..2ea24867af 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -1432,6 +1432,15 @@ void tst_qquicktextinput::horizontalAlignment_RightToLeft() QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QVERIFY(textInput->boundingRect().right() >= textInput->width() - 1); QVERIFY(textInput->boundingRect().right() <= textInput->width() + 1); + + // neutral text should fall back to input direction + textInput->setFocus(true); + textInput->resetHAlign(); + textInput->setText(" ()((=<>"); + platformInputContext.setInputDirection(Qt::LeftToRight); + QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignLeft); + platformInputContext.setInputDirection(Qt::RightToLeft); + QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignRight); } void tst_qquicktextinput::verticalAlignment() |