summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-24 20:20:56 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-24 20:20:56 (GMT)
commite4002434bfde5c8206463ea3a0d4140835619944 (patch)
treef199a1e233867ab4e85d22aa138391585af75fca /tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
parent3f183debfd677b952b015f6950131dd25bd4768b (diff)
parent5a7c14af3c27089b0b8698da3c689637ffaa9cfa (diff)
downloadQt-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.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 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"