diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-06-01 01:37:05 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-06-01 01:37:05 (GMT) |
commit | 06df53baf46ea7968b23f8b325990d047b5a67a5 (patch) | |
tree | dd54bb1d6133987235bbf6e5d2ab5b7d514dfe09 /tests/auto/qtextlayout | |
parent | ff93c3562f2b73abb69b1698f71fc9538ca5d999 (diff) | |
parent | 283e899c7d57c003facc5ed8aef8e5dacf2eb945 (diff) | |
download | Qt-06df53baf46ea7968b23f8b325990d047b5a67a5.zip Qt-06df53baf46ea7968b23f8b325990d047b5a67a5.tar.gz Qt-06df53baf46ea7968b23f8b325990d047b5a67a5.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/qtextlayout')
-rw-r--r-- | tests/auto/qtextlayout/tst_qtextlayout.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index caf9bd3..1a5f493 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -110,6 +110,8 @@ private slots: void longText(); void widthOfTabs(); void columnWrapWithTabs(); + void boundingRectForUnsetLineWidth(); + void boundingRectForSetLineWidth(); // QTextLine stuff void setNumColumnsWrapAtWordBoundaryOrAnywhere(); @@ -1307,6 +1309,29 @@ void tst_QTextLayout::columnWrapWithTabs() } +void tst_QTextLayout::boundingRectForUnsetLineWidth() +{ + QTextLayout layout("FOOBAR"); + + layout.beginLayout(); + QTextLine line = layout.createLine(); + layout.endLayout(); + + QCOMPARE(layout.boundingRect().width(), line.naturalTextWidth()); +} + +void tst_QTextLayout::boundingRectForSetLineWidth() +{ + QTextLayout layout("FOOBAR"); + + layout.beginLayout(); + QTextLine line = layout.createLine(); + line.setLineWidth(QFIXED_MAX - 1); + layout.endLayout(); + + QCOMPARE(layout.boundingRect().width(), qreal(QFIXED_MAX - 1)); +} + void tst_QTextLayout::lineWidthFromBOM() { const QString string(QChar(0xfeff)); // BYTE ORDER MARK |