diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-17 12:26:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-23 04:06:04 +0100 |
commit | 924a9620d528da85dc19df7573d33ba4132e5a3a (patch) | |
tree | ff4ff9efceaf95df8ed0f4fec3b16c3379defa84 /tests | |
parent | c5f65d859720c9345f995136301f6809bbb82867 (diff) |
Fix Text eliding with implicit height and maximumLineCount.
Ignore the height of the text if the element height is invalid.
Task-number: QTBUG-24293
Change-Id: I1646c3f64583da40e6166aeea24c2c4af42cb279
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtquick2/qquicktext/data/multilineelide.qml | 2 | ||||
-rw-r--r-- | tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qtquick2/qquicktext/data/multilineelide.qml b/tests/auto/qtquick2/qquicktext/data/multilineelide.qml index f3bb65775b..ffca0d638a 100644 --- a/tests/auto/qtquick2/qquicktext/data/multilineelide.qml +++ b/tests/auto/qtquick2/qquicktext/data/multilineelide.qml @@ -1,7 +1,7 @@ import QtQuick 2.0 Text { - width: 200; height: 200 + width: 200 wrapMode: Text.WordWrap elide: Text.ElideRight maximumLineCount: 3 diff --git a/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp b/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp index 86d502f07e..c28de8b53c 100644 --- a/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp @@ -471,6 +471,12 @@ void tst_qquicktext::multilineElide() qreal lineHeight = myText->contentHeight() / 3.; + // Set a valid height greater than the truncated content height and ensure the line count is + // unchanged. + myText->setHeight(200); + QCOMPARE(myText->lineCount(), 3); + QCOMPARE(myText->truncated(), true); + // reduce size and ensure fewer lines are drawn myText->setHeight(lineHeight * 2); QCOMPARE(myText->lineCount(), 2); |