diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:36:04 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:36:04 +0100 |
commit | ad67ec26d0cbc98e3440dd38bb20eef4da2ee96d (patch) | |
tree | 9f8135751df2f995a4f55837ea065a4687245b71 /tests/auto/quick/qquicktext | |
parent | 83a16630c13969e68cd3a5aaab73335ccb0d4414 (diff) | |
parent | 20d160d0513a04be187ed851a25b029f47c27b27 (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
.qmake.conf
LICENSE.GPLv2
examples/qml/networkaccessmanagerfactory/view.qml
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4stringobject.cpp
Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r-- | tests/auto/quick/qquicktext/data/growFromZeroWidth.qml | 8 | ||||
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/data/growFromZeroWidth.qml b/tests/auto/quick/qquicktext/data/growFromZeroWidth.qml new file mode 100644 index 0000000000..a264191e45 --- /dev/null +++ b/tests/auto/quick/qquicktext/data/growFromZeroWidth.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Text { + width: 0 + wrapMode: Text.Wrap + horizontalAlignment: Text.AlignHCenter + text: "AA\nBBBBBBB\nCCCCCCCCCCCCCCCC" +} 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" |