aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext/tst_qquicktext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-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));