KD Reports API Documentation
2.2
|
#include <KDReportsFrame.h>
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 |
Element * | clone () const override |
Frame & | operator= (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) | |
Element & | operator= (const Element &other) |
This class represents a frame, with other elements inside. The frame can be visible or not.
Definition at line 31 of file KDReportsFrame.h.
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.
|
explicit |
Creates a frame.
Definition at line 45 of file KDReportsFrame.cpp.
|
override |
Destroys this frame.
Definition at line 107 of file KDReportsFrame.cpp.
KDReports::Frame::Frame | ( | const Frame & | other | ) |
Copies a frame. The contents are copied over.
Definition at line 50 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 116 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 111 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 121 of file KDReportsFrame.cpp.
qreal KDReports::Frame::border | ( | ) | const |
Returns the width of the frame
Definition at line 92 of file KDReportsFrame.cpp.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 126 of file KDReportsFrame.cpp.
References KDReports::ReportBuilder::addBlockElement(), KDReports::ReportBuilder::addInlineElement(), KDReports::ReportBuilder::addVariable(), KDReports::ReportBuilder::addVerticalSpacing(), 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_value, KDReports::ElementData::m_variableType, KDReports::Millimeters, KDReports::mmToPixels(), KDReports::ReportBuilder::report(), KDReports::ElementData::Variable, and KDReports::ElementData::VerticalSpacing.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 179 of file KDReportsFrame.cpp.
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=().
qreal KDReports::Frame::padding | ( | ) | const |
Returns the width of the frame's internal padding in millimeters.
Definition at line 82 of file KDReportsFrame.cpp.
KDReports::Frame::Position KDReports::Frame::position | ( | ) | const |
Returns the position of the frame in the document
Definition at line 102 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 87 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 71 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 77 of file KDReportsFrame.cpp.
void KDReports::Frame::setPosition | ( | Position | pos | ) |
Specifies the position of the frame in the document
Definition at line 97 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 65 of file KDReportsFrame.cpp.