diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-21 08:46:34 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-21 08:46:34 (GMT) |
commit | a3c66f6898c560820ff5768159e4af1323219161 (patch) | |
tree | 143fa35cd328a2d9fb4690d703050d01eb407bbb /tests/auto/qtextlayout/tst_qtextlayout.cpp | |
parent | 51c2b10379b0bbed5804f0f8e2eca82e5bb4d0bf (diff) | |
parent | 86ceda033eda6bd615134f71b9850081a0c808c9 (diff) | |
download | Qt-a3c66f6898c560820ff5768159e4af1323219161.zip Qt-a3c66f6898c560820ff5768159e4af1323219161.tar.gz Qt-a3c66f6898c560820ff5768159e4af1323219161.tar.bz2 |
Merge remote branch 'qt/master' into staging-master
Conflicts:
src/gui/image/qpnghandler.cpp
src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'tests/auto/qtextlayout/tst_qtextlayout.cpp')
-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 0a14e4a..83c7094 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -126,6 +126,7 @@ private slots: void textWidthVsWIdth(); void textWithSurrogates_qtbug15679(); void textWidthWithStackedTextEngine(); + void textWidthWithLineSeparator(); private: QFont testFont; @@ -1443,5 +1444,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" |