diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-06-01 03:09:17 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-06-01 03:09:17 (GMT) |
commit | 33a65a1def8e6d40819ead6e7548cb7345f3b922 (patch) | |
tree | f00cf93cb202d8d54ebacd3dedc01ff31d23a9a4 /tests/auto/qtextlayout | |
parent | 91cb226780d05f0f7d8fd1875121427ade52c1a8 (diff) | |
parent | 5f6b50f99a6457c208c7f186db45a2dba690bace (diff) | |
download | Qt-33a65a1def8e6d40819ead6e7548cb7345f3b922.zip Qt-33a65a1def8e6d40819ead6e7548cb7345f3b922.tar.gz Qt-33a65a1def8e6d40819ead6e7548cb7345f3b922.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 |