aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-24 16:37:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-01-24 18:27:41 +0100
commit22041acdfe85c9a9b814e11cd86e8ee5a55be82d (patch)
tree1b4d1bfa0ebba9e5d1495b5ca7055dba94642c46 /tests/auto/quick/qquicktext
parent6ae57f01bb1495a74b23a81c590672ce788d5400 (diff)
parent2407cd29e628671f7f5144e0d241d4249a3ab612 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/imports/dialogs/qquickmessagedialog.cpp src/imports/dialogs/qquickmessagedialog_p.h src/qml/debugger/qqmlprofilerservice_p.h src/qml/jsruntime/qv4regexpobject.cpp tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index d241ac2d70..e6a74bb062 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -1724,6 +1724,12 @@ void tst_qquicktext::linkInteraction_data()
<< (PointVector() << metrics.characterRectangle(18, Qt::AlignRight, Qt::AlignBottom).center())
<< singleLineLink
<< singleLineLink << singleLineLink;
+ QTest::newRow("click on mirrored link")
+ << singleLineText << 240.
+ << "horizontalAlignment: Text.AlignLeft; LayoutMirroring.enabled: true"
+ << (PointVector() << metrics.characterRectangle(18, Qt::AlignRight, Qt::AlignTop).center())
+ << singleLineLink
+ << singleLineLink << singleLineLink;
QTest::newRow("click on center aligned link")
<< singleLineText << 240.
<< "horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter"
@@ -2545,6 +2551,18 @@ void tst_qquicktext::boundingRect()
QCOMPARE(text->boundingRect().width(), line.naturalTextWidth());
QCOMPARE(text->boundingRect().height(), line.height());
+ QQuickItemPrivate::get(text)->setLayoutMirror(true);
+ QCOMPARE(text->boundingRect().x(), qreal(0));
+ QCOMPARE(text->boundingRect().y(), qreal(0));
+ QCOMPARE(text->boundingRect().width(), line.naturalTextWidth());
+ QCOMPARE(text->boundingRect().height(), line.height());
+
+ text->setHAlign(QQuickText::AlignLeft);
+ QCOMPARE(text->boundingRect().x(), text->width() - line.naturalTextWidth());
+ QCOMPARE(text->boundingRect().y(), qreal(0));
+ QCOMPARE(text->boundingRect().width(), line.naturalTextWidth());
+ QCOMPARE(text->boundingRect().height(), line.height());
+
text->setWrapMode(QQuickText::Wrap);
QCOMPARE(text->boundingRect().right(), text->width());
QCOMPARE(text->boundingRect().y(), qreal(0));