KD Reports  1.8
Public Member Functions | List of all members
KDReports::Header Class Reference

#include <KDReportsHeader.h>

Public Member Functions

void setDefaultFont (const QFont &font)
 
QFont defaultFont () const
 
void addInlineElement (const Element &element)
 
void addElement (const Element &element, Qt::AlignmentFlag horizontalAlignment=Qt::AlignLeft)
 
void addVariable (VariableType variable)
 
void addVerticalSpacing (qreal space)
 
void setTabPositions (const QList< QTextOption::Tab > &tabs)
 

Detailed Description

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.

Member Function Documentation

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.

void KDReports::Header::addInlineElement ( const Element element)

Adds an element to the report, next to the previous element, in the same paragraph.

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":

header.addInlineElement( KDReports::TextElement( "Page " ) );
header.addVariable( KDReports::PageNumber );
header.addInlineElement( KDReports::TextElement( " / " ) );
header.addVariable( KDReports::PageCount );
void KDReports::Header::addVerticalSpacing ( qreal  space)

Adds vertical spacing between paragraphs. Make sure to call addElement after that, not addInlineElement.

Parameters
spacethe space in millimeters
QFont KDReports::Header::defaultFont ( ) const
Returns
the default font used for text in this header
Since
1.4
void KDReports::Header::setDefaultFont ( const QFont &  font)

Sets the default font used for text in this header

Since
1.1
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.

Since
1.2

The documentation for this class was generated from the following file:

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-reports/