32 : d(new HeaderPrivate(report))
37 KDReports::Header::~Header()
44 d->m_builder.addInlineElementPublic(element);
50 d->m_builder.addBlockElementPublic(element, horizontalAlignment);
56 return d->m_textDocument;
67 return QString::number(pageNumber + 1);
75 return QLocale::system().toString(QDate::currentDate(), QLocale::ShortFormat);
77 return QLocale::system().toString(QDate::currentDate(), QLocale::LongFormat);
80 return QLocale().toString(QDate::currentDate(), QLocale::ShortFormat);
82 return QLocale().toString(QDate::currentDate(), QLocale::LongFormat);
88 return QLocale().toString(QTime::currentTime(), QLocale::ShortFormat);
90 qWarning() <<
"Program error, variable" << type <<
"not implemented";
98 QTextCursor c(&textDoc);
100 c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
101 QTextCharFormat charFormat = c.charFormat();
105 c.setCharFormat(charFormat);
117 d->m_builder.addVariablePublic(variable);
122 d->m_builder.addVerticalSpacingPublic(space);
125 void KDReports::Header::preparePaintingPage(
int pageNumber)
128 QTextCursor c(&d->m_textDocument.contentDocument());
130 c.movePosition(QTextCursor::NextCharacter);
132 QTextCharFormat format = c.charFormat();
135 c.movePosition(QTextCursor::PreviousCharacter);
140 const int startPos = c.position();
141 c.setPosition(c.position() + oldLength, QTextCursor::KeepAnchor);
145 setVariableMarker(d->m_textDocument.contentDocument(), startPos, variableType, value.length());
147 }
while (!c.atEnd());
153 f.setStyleStrategy(QFont::ForceOutline);
154 d->m_textDocument.contentDocument().setDefaultFont(f);
155 d->m_builder.setDefaultFont(f);
160 return d->m_textDocument.contentDocument().defaultFont();
165 d->m_builder.setTabPositions(tabs);
170 return d->m_builder.currentPosition();