diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-24 01:00:07 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-24 01:00:07 +0100 |
commit | df8784fa1fc4792007393ea995756c2d490691d7 (patch) | |
tree | d4b8d6bdc855e4045c39f7710f206b7cfcf3d493 /tests/auto/quick/qquicktext | |
parent | b799e061a3cbf995ac7c88b315f5916e3a687162 (diff) | |
parent | 5246b910771e0dd824b4eea7c5245e5f9f3a63f0 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I57e4b762dcccf2f7f6e4b659f6fc8c40465d3322
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r-- | tests/auto/quick/qquicktext/data/contentHeight.qml | 7 | ||||
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 14 |
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); |