diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-15 18:41:17 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-15 18:41:17 (GMT) |
commit | 411938c541a6c3993b47f1f86d844f12c1651351 (patch) | |
tree | 3da5d56db8f1b5aa6694277fc369472d2cc82e4e /tests | |
parent | ef93b78f38d7f35f42bc896ad23263668ac9f2e7 (diff) | |
parent | f4244785cb8875b177274db485a346605f05ed7c (diff) | |
download | Qt-411938c541a6c3993b47f1f86d844f12c1651351.zip Qt-411938c541a6c3993b47f1f86d844f12c1651351.tar.gz Qt-411938c541a6c3993b47f1f86d844f12c1651351.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Designer: Fix a bug affecting tab reordering of promoted tab widgets.
Designer: Fix a bug clearing the Z-Order when adding a new widget.
Adjust right bearing when breaking with line separators
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtextlayout/tst_qtextlayout.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 0f1ff66..2d15566 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -124,6 +124,7 @@ private slots: void lineWidthFromBOM(); void textWidthVsWIdth(); void textWidthWithStackedTextEngine(); + void textWidthWithLineSeparator(); private: QFont testFont; @@ -1399,5 +1400,21 @@ void tst_QTextLayout::textWidthWithStackedTextEngine() QCOMPARE(line.naturalTextWidth(), fm.width(text)); } +void tst_QTextLayout::textWidthWithLineSeparator() +{ + QString s1("Save Project"), s2("Save Project\ntest"); + s2.replace('\n', QChar::LineSeparator); + + QTextLayout layout1(s1), layout2(s2); + layout1.beginLayout(); + layout2.beginLayout(); + + QTextLine line1 = layout1.createLine(); + QTextLine line2 = layout2.createLine(); + line1.setLineWidth(0x1000); + line2.setLineWidth(0x1000); + QCOMPARE(line1.naturalTextWidth(), line2.naturalTextWidth()); +} + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" |