diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-24 21:26:33 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-24 21:50:29 +0200 |
commit | 0837453ef90f5d5f569702aa1c7620648dae2c00 (patch) | |
tree | 43a35f937dfcca3f467d4deafe2800d01f0859da /tests/auto/quick/qquicktext/tst_qquicktext.cpp | |
parent | 9ff09fb283cd130fb717769b44f54bfbb28efd8a (diff) | |
parent | 0ba6dffd96a0dda8e3938b09395075c19e46644b (diff) |
Merge remote-tracking branch 'origin/dev' into HEAD
Change-Id: If91e0e28d004f1db978dcab393f189743bb69cd5
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 22 |
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" |