summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextdocumentlayout
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qtextdocumentlayout')
-rw-r--r--tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp b/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
index 38a1e51..01d2758 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"