KD Reports API Documentation
2.0
|
#include <KDReportsFrame.h>
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 |
Element * | clone () const override |
Frame & | operator= (const Frame &other) |
qreal | padding () const |
void | setBorder (qreal border) |
void | setHeight (qreal height, Unit unit=Millimeters) |
void | setPadding (qreal padding) |
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) | |
Element & | operator= (const Element &other) |
This class represents a frame, with other elements inside. The frame can be visible or not.
Definition at line 51 of file KDReportsFrame.h.
|
explicit |
Creates a frame.
Definition at line 48 of file KDReportsFrame.cpp.
|
override |
Destroys this frame.
Definition at line 100 of file KDReportsFrame.cpp.
KDReports::Frame::Frame | ( | const Frame & | other | ) |
Copies a frame. The contents are copied over.
Definition at line 53 of file KDReportsFrame.cpp.
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 110 of file KDReportsFrame.cpp.
References KDReports::Element::clone().
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 105 of file KDReportsFrame.cpp.
References KDReports::Element::clone().
void KDReports::Frame::addVariable | ( | VariableType | variable | ) |
Adds an variable in the text of the current paragraph.
Definition at line 115 of file KDReportsFrame.cpp.
qreal KDReports::Frame::border | ( | ) | const |
Returns the width of the frame
Definition at line 95 of file KDReportsFrame.cpp.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 120 of file KDReportsFrame.cpp.
References KDReports::ReportBuilder::addBlockElement(), KDReports::ReportBuilder::addInlineElement(), KDReports::ReportBuilder::addVariable(), KDReports::ElementData::Block, KDReports::ReportBuilder::copyStateFrom(), KDReports::ReportBuilder::currentDocumentData(), KDReports::ReportBuilder::cursor(), KDReports::ElementData::Inline, KDReports::ElementData::m_align, KDReports::ElementData::m_element, KDReports::ElementData::m_type, KDReports::ElementData::m_variableType, KDReports::Millimeters, KDReports::mmToPixels(), KDReports::ReportBuilder::report(), and KDReports::ElementData::Variable.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 170 of file KDReportsFrame.cpp.
KDReports::Frame & KDReports::Frame::operator= | ( | const Frame & | other | ) |
Copies the text and settings from another frame.
Definition at line 59 of file KDReportsFrame.cpp.
References KDReports::Element::operator=().
qreal KDReports::Frame::padding | ( | ) | const |
Returns the width of the frame's internal padding in millimeters.
Definition at line 85 of file KDReportsFrame.cpp.
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 90 of file KDReportsFrame.cpp.
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 74 of file KDReportsFrame.cpp.
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 80 of file KDReportsFrame.cpp.
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 68 of file KDReportsFrame.cpp.