summaryrefslogtreecommitdiff
path: root/tests/auto/declarative/qdeclarativetextinput
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2011-03-08 18:05:25 +1000
committerJoona Petrell <joona.t.petrell@nokia.com>2011-03-09 17:40:27 +1000
commitaeb330e3999ef3d7ae8d94b9330471f2a2a13554 (patch)
treeca612930c19dba6464d7af163a04405282d51cfb /tests/auto/declarative/qdeclarativetextinput
parent0d6ce63ea84b076efbebfae0f6f39f492d8d7bcf (diff)
downloadqt4-tools-aeb330e3999ef3d7ae8d94b9330471f2a2a13554.tar.gz
Fix horizontal alignment of QTextDocument-based RTL text
Task-number: QTBUG-15880 Reviewed-by: Martin Jones Change-Id: If537d7c795dec46eedee62511e75bab862676ef1
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextinput')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index fc19c94878..734f91f22e 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -1125,6 +1125,15 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
delete canvas;
+
+ // alignment of TextInput with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextInput {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextInput *textObject = qobject_cast<QDeclarativeTextInput*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ delete textObject;
}
void tst_qdeclarativetextinput::positionAt()