KD Reports API Documentation  2.2
Public Types | Public Member Functions | List of all members
KDReports::Frame Class Reference

#include <KDReportsFrame.h>

Inheritance diagram for KDReports::Frame:
KDReports::Element

Public Types

enum  Position { InFlow , FloatLeft , FloatRight }
 

Public Member Functions

 Frame ()
 
 Frame (const Frame &other)
 
 ~Frame () override
 
void addElement (const Element &element, Qt::AlignmentFlag horizontalAlignment=Qt::AlignLeft)
 
void addInlineElement (const Element &element)
 
void addVariable (VariableType variable)
 
qreal border () const
 
void build (ReportBuilder &builder) const override
 
Elementclone () const override
 
Frameoperator= (const Frame &other)
 
qreal padding () const
 
Position position () const
 
void setBorder (qreal border)
 
void setHeight (qreal height, Unit unit=Millimeters)
 
void setPadding (qreal padding)
 
void setPosition (Position pos)
 
void setWidth (qreal width, Unit unit=Millimeters)
 
- Public Member Functions inherited from KDReports::Element
virtual ~Element ()
 
QBrush background () const
 
void setBackground (const QBrush &brush)
 

Additional Inherited Members

- Protected Member Functions inherited from KDReports::Element
 Element ()
 
 Element (const Element &other)
 
Elementoperator= (const Element &other)
 

Detailed Description

This class represents a frame, with other elements inside. The frame can be visible or not.

Since
1.7

Definition at line 31 of file KDReportsFrame.h.

Member Enumeration Documentation

◆ Position

Enumerator
InFlow 

The frame is part of the flow of the paragraph (default)

FloatLeft 

The frame floats on the left side of the text.

FloatRight 

The frame floats on the right side of the text.

Definition at line 87 of file KDReportsFrame.h.

Constructor & Destructor Documentation

◆ Frame() [1/2]

KDReports::Frame::Frame ( )
explicit

Creates a frame.

Definition at line 45 of file KDReportsFrame.cpp.

◆ ~Frame()

KDReports::Frame::~Frame ( )
override

Destroys this frame.

Definition at line 107 of file KDReportsFrame.cpp.

◆ Frame() [2/2]

KDReports::Frame::Frame ( const Frame other)

Copies a frame. The contents are copied over.

Definition at line 50 of file KDReportsFrame.cpp.

Member Function Documentation

◆ addElement()

void KDReports::Frame::addElement ( const Element element,
Qt::AlignmentFlag  horizontalAlignment = Qt::AlignLeft 
)

Adds an element to the frame, creating a new paragraph for it. You can specify the alignment of that paragraph.

Definition at line 116 of file KDReportsFrame.cpp.

References KDReports::Element::clone().

◆ addInlineElement()

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

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

Definition at line 111 of file KDReportsFrame.cpp.

References KDReports::Element::clone().

◆ addVariable()

void KDReports::Frame::addVariable ( VariableType  variable)

Adds an variable in the text of the current paragraph.

See also
KDReportsHeader::addVariable

Definition at line 121 of file KDReportsFrame.cpp.

◆ border()

qreal KDReports::Frame::border ( ) const

Returns the width of the frame

Definition at line 92 of file KDReportsFrame.cpp.

◆ build()

void KDReports::Frame::build ( ReportBuilder builder) const
overridevirtual

◆ clone()

KDReports::Element * KDReports::Frame::clone ( ) const
overridevirtual

Implements KDReports::Element.

Definition at line 179 of file KDReportsFrame.cpp.

◆ operator=()

KDReports::Frame & KDReports::Frame::operator= ( const Frame other)

Copies the text and settings from another frame.

Definition at line 56 of file KDReportsFrame.cpp.

References KDReports::Element::operator=().

◆ padding()

qreal KDReports::Frame::padding ( ) const

Returns the width of the frame's internal padding in millimeters.

Definition at line 82 of file KDReportsFrame.cpp.

◆ position()

KDReports::Frame::Position KDReports::Frame::position ( ) const

Returns the position of the frame in the document

Since
2.2

Definition at line 102 of file KDReportsFrame.cpp.

◆ setBorder()

void KDReports::Frame::setBorder ( qreal  border)

Specifies the width of the border in pixels. The default border has a width of 1. Set it to 0 for a frame without borders.

Definition at line 87 of file KDReportsFrame.cpp.

◆ setHeight()

void KDReports::Frame::setHeight ( qreal  height,
KDReports::Unit  unit = Millimeters 
)

Set the frame height in millimeters or in percent of the page height.

Definition at line 71 of file KDReportsFrame.cpp.

◆ setPadding()

void KDReports::Frame::setPadding ( qreal  padding)

Specifies the size of the padding in millimeters. Padding is the distance between the contents of the frame and the frame border, all around the contents (above, below, on the left and on the right). The default padding has a size of 0.5 mm.

Definition at line 77 of file KDReportsFrame.cpp.

◆ setPosition()

void KDReports::Frame::setPosition ( Position  pos)

Specifies the position of the frame in the document

Since
2.2

Definition at line 97 of file KDReportsFrame.cpp.

◆ setWidth()

void KDReports::Frame::setWidth ( qreal  width,
KDReports::Unit  unit = Millimeters 
)

Set the frame width in millimeters or in percent of the page width.

Definition at line 65 of file KDReportsFrame.cpp.


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

© 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 by doxygen 1.9.1