aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext/tst_qquicktext.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-24 21:26:33 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-24 21:50:29 +0200
commit0837453ef90f5d5f569702aa1c7620648dae2c00 (patch)
tree43a35f937dfcca3f467d4deafe2800d01f0859da /tests/auto/quick/qquicktext/tst_qquicktext.cpp
parent9ff09fb283cd130fb717769b44f54bfbb28efd8a (diff)
parent0ba6dffd96a0dda8e3938b09395075c19e46644b (diff)
Merge remote-tracking branch 'origin/dev' into HEAD
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 8b7d8c0711..6c0da40b8e 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -149,6 +149,8 @@ private slots:
void hintingPreference();
+ void zeroWidthAndElidedDoesntRender();
+
private:
QStringList standard;
QStringList richText;
@@ -4175,6 +4177,26 @@ void tst_qquicktext::hintingPreference()
}
+void tst_qquicktext::zeroWidthAndElidedDoesntRender()
+{
+ // Tests QTBUG-34990
+
+ QQmlComponent component(&engine, testFile("ellipsisText.qml"));
+
+ QScopedPointer<QObject> object(component.create());
+
+ QQuickText *text = qobject_cast<QQuickText *>(object.data());
+ QVERIFY(text);
+
+ QCOMPARE(text->contentWidth(), 0.0);
+
+ QQuickText *reference = text->findChild<QQuickText *>("elidedRef");
+ QVERIFY(reference);
+
+ text->setWidth(10);
+ QCOMPARE(text->contentWidth(), reference->contentWidth());
+}
+
QTEST_MAIN(tst_qquicktext)
#include "tst_qquicktext.moc"