28 m_contentDocument.layoutWithTextWidth(w);
33 m_contentDocument.setPageSize(size);
38 return m_contentDocument;
43 return contentDocumentData().document();
48 return m_contentDocument.document().defaultFont();
53 m_contentDocument.scaleFontsBy(factor);
58 m_contentDocument.updateTextValue(
id, newValue);
64 return m_contentDocument.asHtml();
71 qDebug() <<
"Dumping document:";
72 QTextCursor cursor( &m_contentDocument );
74 int currentBlock = -1;
76 const int blockNumber = cursor.block().blockNumber();
77 if ( blockNumber != currentBlock ) {
78 currentBlock = blockNumber;
79 qDebug() <<
" block" << currentBlock <<
"starts at char" << i;
80 QTextFormat::PageBreakFlags flags = cursor.block().blockFormat().pageBreakPolicy();
81 if ( flags & QTextFormat::PageBreak_AlwaysBefore )
82 qDebug() <<
" block" << currentBlock <<
"says: BREAK BEFORE";
83 if ( flags & QTextFormat::PageBreak_AlwaysAfter )
84 qDebug() <<
" block" << currentBlock <<
"says: BREAK AFTER";
86 const QChar ch = m_contentDocument.characterAt( i );
87 qDebug() <<
" char" << i << ch << ch.unicode();
89 if ( cursor.atEnd() ) {
90 qDebug() <<
" document ends at" << cursor.position();
93 cursor.movePosition( QTextCursor::NextCharacter );
102 return m_contentDocument.autoTableElements();
107 m_contentDocument.regenerateAutoTables();
112 m_contentDocument.regenerateAutoTableForModel(model);
QTextDocument & contentDocument()
void regenerateAutoTables()
void layoutWithTextWidth(qreal w)
QList< KDReports::AutoTableElement * > autoTableElements()
QFont defaultFont() const
void regenerateAutoTableForModel(QAbstractItemModel *model)
TextDocumentData & contentDocumentData()
void scaleFontsBy(qreal factor)
void updateTextValue(const QString &id, const QString &newValue)
void setPageSize(QSizeF size)