KD Reports API Documentation  2.0
Public Member Functions | List of all members
KDReports::Header Class Reference

#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)
 

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.

Definition at line 49 of file KDReportsHeader.h.

Member Function Documentation

◆ addElement()

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 48 of file KDReportsHeader.cpp.

◆ addInlineElement()

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 42 of file KDReportsHeader.cpp.

◆ addVariable()

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 );

Definition at line 115 of file KDReportsHeader.cpp.

◆ addVerticalSpacing()

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

Definition at line 120 of file KDReportsHeader.cpp.

◆ currentPosition()

int KDReports::Header::currentPosition ( ) const

Definition at line 168 of file KDReportsHeader.cpp.

◆ defaultFont()

QFont KDReports::Header::defaultFont ( ) const
Returns
the default font used for text in this header
Since
1.4

Definition at line 158 of file KDReportsHeader.cpp.

◆ setDefaultFont()

void KDReports::Header::setDefaultFont ( const QFont &  font)

Sets the default font used for text in this header

Since
1.1

Definition at line 150 of file KDReportsHeader.cpp.

Referenced by parseHeaderFooterAttribute().

◆ setTabPositions()

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

Definition at line 163 of file KDReportsHeader.cpp.


The documentation for this class was generated from the following files:
KDReports::PageNumber
@ PageNumber
Page number.
Definition: KDReportsVariableType.h:30
KDReports::TextElement
Definition: KDReportsTextElement.h:36
KDReports::PageCount
@ PageCount
Page count.
Definition: KDReportsVariableType.h:31

© 2007-2021 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/
Generated on Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17