aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-24 01:00:07 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-24 01:00:07 +0100
commitdf8784fa1fc4792007393ea995756c2d490691d7 (patch)
treed4b8d6bdc855e4045c39f7710f206b7cfcf3d493 /tests/auto/quick/qquicktext
parentb799e061a3cbf995ac7c88b315f5916e3a687162 (diff)
parent5246b910771e0dd824b4eea7c5245e5f9f3a63f0 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r--tests/auto/quick/qquicktext/data/contentHeight.qml7
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp14
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/data/contentHeight.qml b/tests/auto/quick/qquicktext/data/contentHeight.qml
new file mode 100644
index 0000000000..472e97078e
--- /dev/null
+++ b/tests/auto/quick/qquicktext/data/contentHeight.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.9
+
+Text{
+ width: 200
+ height: contentHeight
+ text: ''
+}
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index d8ff2f6e13..fd0ba0f49b 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -160,6 +160,8 @@ private slots:
void fontInfo();
+ void initialContentHeight();
+
private:
QStringList standard;
QStringList richText;
@@ -4384,6 +4386,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);