summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2011-03-08 08:05:25 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2011-03-09 07:40:27 (GMT)
commitaeb330e3999ef3d7ae8d94b9330471f2a2a13554 (patch)
treeca612930c19dba6464d7af163a04405282d51cfb /tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
parent0d6ce63ea84b076efbebfae0f6f39f492d8d7bcf (diff)
downloadQt-aeb330e3999ef3d7ae8d94b9330471f2a2a13554.zip
Qt-aeb330e3999ef3d7ae8d94b9330471f2a2a13554.tar.gz
Qt-aeb330e3999ef3d7ae8d94b9330471f2a2a13554.tar.bz2
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/tst_qdeclarativetextinput.cpp')
-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 fc19c94..734f91f 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()