KD Reports API Documentation
2.2
|
#include <KDReportsHeader.h>
Public Member Functions | |
void | addElement (const Element &element, Qt::AlignmentFlag horizontalAlignment=Qt::AlignLeft) |
void | addInlineElement (const Element &element) |
void | addVariable (VariableType variable) |
void | addVerticalSpacing (qreal space) |
int | currentPosition () const |
QFont | defaultFont () const |
void | setDefaultFont (const QFont &font) |
void | setTabPositions (const QList< QTextOption::Tab > &tabs) |
This class presents a header or footer in a report. To add an element to a header or footer, first get hold of the right header/footer using Report::header() or Report::footer(), then add elements to it.
Definition at line 44 of file KDReportsHeader.h.
void KDReports::Header::addElement | ( | const Element & | element, |
Qt::AlignmentFlag | horizontalAlignment = Qt::AlignLeft |
||
) |
Adds an element to the report, creating a new paragraph for it. You can specify the alignment of that paragraph.
Definition at line 41 of file KDReportsHeader.cpp.
void KDReports::Header::addInlineElement | ( | const Element & | element | ) |
Adds an element to the report, next to the previous element, in the same paragraph.
Definition at line 35 of file KDReportsHeader.cpp.
void KDReports::Header::addVariable | ( | VariableType | variable | ) |
Adds a variable in the text of the current paragraph. Use addInlineElement before and/or after to complete the text of the paragraph. Example: "Page 1 / 3":
Definition at line 108 of file KDReportsHeader.cpp.
void KDReports::Header::addVerticalSpacing | ( | qreal | space | ) |
Adds vertical spacing between paragraphs. Make sure to call addElement after that, not addInlineElement.
space | the space in millimeters |
Definition at line 113 of file KDReportsHeader.cpp.
int KDReports::Header::currentPosition | ( | ) | const |
Definition at line 161 of file KDReportsHeader.cpp.
QFont KDReports::Header::defaultFont | ( | ) | const |
Definition at line 151 of file KDReportsHeader.cpp.
void KDReports::Header::setDefaultFont | ( | const QFont & | font | ) |
Sets the default font used for text in this header
Definition at line 143 of file KDReportsHeader.cpp.
Referenced by parseHeaderFooterAttribute().
void KDReports::Header::setTabPositions | ( | const QList< QTextOption::Tab > & | tabs | ) |
Set the list of tabs (tabulations) to use when adding block elements. Those tabs will be set for any block element that is added from now on, in this header. For more details see Report::setTabPositions.
Definition at line 156 of file KDReportsHeader.cpp.