aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext/tst_qquicktext.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-11-19 09:20:16 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-11-20 17:37:47 +0000
commit63ada5fa00ba37e0fbfcd7b70dcbd99580dd7c4f (patch)
treec5a1265ca20c5284a4b815cd5f5b4ad0fc5dedf7 /tests/auto/quick/qquicktext/tst_qquicktext.cpp
parent9a7c5a925c4d62f4fe23d31b1f8636d415b6307c (diff)
QQuickText: Signal content height/width changes also when resetting
If we change the content height or content width to the initial one, we still need to signal the change. Fixes: QTBUG-71684 Change-Id: Idf6e3f89423eab3d8f5310c164c5acc5108e0d8b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 63e023644f..a9c35e0cc4 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -159,6 +159,8 @@ private slots:
void fontInfo();
+ void initialContentHeight();
+
private:
QStringList standard;
QStringList richText;
@@ -4383,6 +4385,18 @@ void tst_qquicktext::fontInfo()
QVERIFY(copy->font().pixelSize() < 1000);
}
+void tst_qquicktext::initialContentHeight()
+{
+ QQmlComponent component(&engine, testFile("contentHeight.qml"));
+ QVERIFY(component.isReady());
+ QScopedPointer<QObject> object(component.create());
+ QObject *root = object.data();
+ QVERIFY(root);
+ QQuickText *text = qobject_cast<QQuickText *>(root);
+ QVERIFY(text);
+ QCOMPARE(text->height(), text->contentHeight());
+}
+
void tst_qquicktext::implicitSizeChangeRewrap()
{
QScopedPointer<QQuickView> window(new QQuickView);