diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-24 20:20:56 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-24 20:20:56 (GMT) |
commit | e4002434bfde5c8206463ea3a0d4140835619944 (patch) | |
tree | f199a1e233867ab4e85d22aa138391585af75fca /tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp | |
parent | 3f183debfd677b952b015f6950131dd25bd4768b (diff) | |
parent | 5a7c14af3c27089b0b8698da3c689637ffaa9cfa (diff) | |
download | Qt-e4002434bfde5c8206463ea3a0d4140835619944.zip Qt-e4002434bfde5c8206463ea3a0d4140835619944.tar.gz Qt-e4002434bfde5c8206463ea3a0d4140835619944.tar.bz2 |
Merge branch '4.6'
Diffstat (limited to 'tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp')
-rw-r--r-- | tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp b/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp index d8c4f51..dbba9ef 100644 --- a/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp +++ b/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp @@ -71,6 +71,7 @@ private slots: void wrapAtWordBoundaryOrAnywhere(); void inlineImage(); void clippedTableCell(); + void floatingTablePageBreak(); private: QTextDocument *doc; @@ -250,5 +251,25 @@ void tst_QTextDocumentLayout::clippedTableCell() QCOMPARE(img, expected); } +void tst_QTextDocumentLayout::floatingTablePageBreak() +{ + doc->clear(); + + QTextCursor cursor(doc); + + QTextTableFormat tableFormat; + tableFormat.setPosition(QTextFrameFormat::FloatLeft); + QTextTable *table = cursor.insertTable(50, 1, tableFormat); + + // Make height of document 2/3 of the table, fitting the table into two pages + QSizeF documentSize = doc->size(); + documentSize.rheight() *= 2.0 / 3.0; + + doc->setPageSize(documentSize); + + QCOMPARE(doc->pageCount(), 2); +} + + QTEST_MAIN(tst_QTextDocumentLayout) #include "tst_qtextdocumentlayout.moc" |