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.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 9a7f15c953..4b0bb48a75 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -148,6 +148,8 @@ private slots:
void hover();
+ void growFromZeroWidth();
+
private:
QStringList standard;
QStringList richText;
@@ -3881,6 +3883,23 @@ void tst_qquicktext::hover()
QVERIFY(mouseArea->property("wasHovered").toBool());
}
+void tst_qquicktext::growFromZeroWidth()
+{
+ QQmlComponent component(&engine, testFile("growFromZeroWidth.qml"));
+
+ QScopedPointer<QObject> object(component.create());
+
+ QQuickText *text = qobject_cast<QQuickText *>(object.data());
+ QVERIFY(text);
+
+ QCOMPARE(text->lineCount(), 3);
+
+ text->setWidth(80);
+
+ // the new width should force our contents to wrap
+ QVERIFY(text->lineCount() > 3);
+}
+
QTEST_MAIN(tst_qquicktext)
#include "tst_qquicktext.moc"