26 : d(new HeaderPrivate(report))
28 d->m_textDocument.contentDocument().setDefaultFont(report->d->m_layout->defaultFont());
31KDReports::Header::~Header()
35void KDReports::Header::addInlineElement(
const Element &element)
37 d->m_builder.addInlineElementPublic(element);
41void KDReports::Header::addElement(
const Element &element,
Qt::AlignmentFlag horizontalAlignment)
43 d->m_builder.addBlockElementPublic(element, horizontalAlignment);
49 return d->m_textDocument;
83 qWarning() <<
"Program error, variable" << type <<
"not implemented";
108void KDReports::Header::addVariable(VariableType variable)
110 d->m_builder.addVariablePublic(variable);
113void KDReports::Header::addVerticalSpacing(qreal space)
115 d->m_builder.addVerticalSpacingPublic(space);
118void KDReports::Header::preparePaintingPage(
int pageNumber)
121 QTextCursor c(&d->m_textDocument.contentDocument());
133 const int startPos = c.position();
140 }
while (!c.atEnd());
143void KDReports::Header::setDefaultFont(
const QFont &font)
147 d->m_textDocument.contentDocument().setDefaultFont(f);
148 d->m_builder.setDefaultFont(f);
151QFont KDReports::Header::defaultFont()
const
153 return d->m_textDocument.contentDocument().defaultFont();
158 d->m_builder.setTabPositions(tabs);
161int KDReports::Header::currentPosition()
const
163 return d->m_builder.currentPosition();
int numberOfPages() const
QString variableValue(int pageNumber, KDReports::Report *report, VariableType type)
@ ISODate
names but unlocalized order of names and numbers
@ TextTime
Current time in text format like "13:42:59".
@ SystemLocaleShortDate
Current date formatted according to the system locale, short format, see Qt::SystemLocaleShortDate.
@ LocaleDate
Current date in locale-dependent format, deprecated in favour of SystemLocaleShortDate or SystemLocal...
@ LocaleTime
Current time in locale-dependent format.
@ DefaultLocaleShortDate
Current date formatted according to the application locale, short format, see Qt::DefaultLocaleShortD...
@ ISOTime
Current time in ISO 8601 format like "13:42:59".
@ DefaultLocaleLongDate
Current date formatted according to the application locale, long format, see Qt::DefaultLocaleLongDat...
@ SystemLocaleLongDate
Current date formatted according to the system locale, long format, see Qt::SystemLocaleLongDate.
void setVariableMarker(QTextDocument &textDoc, int pos, KDReports::VariableType variableType, int valueLength)
void cleanupVariableProperties(QTextCharFormat &charFormat)
QString toString(Qt::DateFormat format) const const
QString toString(qlonglong i) const const
QString number(int n, int base)
QTextCharFormat charFormat() const const
bool movePosition(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode, int n)
void setCharFormat(const QTextCharFormat &format)
void setPosition(int pos, QTextCursor::MoveMode m)
void clearProperty(int propertyId)
bool hasProperty(int propertyId) const const
QVariant property(int propertyId) const const
void setProperty(int propertyId, const QVariant &value)
QString toString(Qt::DateFormat format) const const
int toInt(bool *ok) const const