20 class KDReports::FramePrivate
52 , d(new FramePrivate(*other.d))
68 d->m_widthUnit = unit;
74 d->m_heightUnit = unit;
79 d->m_padding = padding;
104 return d->m_position;
129 QTextFrameFormat format;
132 format.setWidth(QTextLength(QTextLength::FixedLength,
mmToPixels(d->m_width)));
134 format.setWidth(QTextLength(QTextLength::PercentageLength, d->m_width));
139 format.setHeight(QTextLength(QTextLength::FixedLength,
mmToPixels(d->m_height)));
141 format.setHeight(QTextLength(QTextLength::PercentageLength, d->m_height));
146 format.setBorder(d->m_border);
148 format.setPosition(
static_cast<QTextFrameFormat::Position
>(d->m_position));
150 QTextCursor &textDocCursor = builder.
cursor();
152 QTextFrame *frame = textDocCursor.insertFrame(format);
154 QTextCursor contentsCursor = frame->firstCursorPosition();
176 textDocCursor.movePosition(QTextCursor::End);
181 return new Frame(*
this);
virtual Element * clone() const =0
Element & operator=(const Element &other)
void addVariable(VariableType variable)
void setBorder(qreal border)
@ InFlow
The frame is part of the flow of the paragraph (default)
Frame & operator=(const Frame &other)
void setWidth(qreal width, Unit unit=Millimeters)
Element * clone() const override
void setPosition(Position pos)
void addInlineElement(const Element &element)
void setHeight(qreal height, Unit unit=Millimeters)
void addElement(const Element &element, Qt::AlignmentFlag horizontalAlignment=Qt::AlignLeft)
void setPadding(qreal padding)
void build(ReportBuilder &builder) const override
Position position() const
TextDocumentData & currentDocumentData()
virtual void addVerticalSpacing(qreal space)
virtual void addBlockElement(const Element &element, Qt::AlignmentFlag horizontalAlignment, const QColor &backgroundColor=QColor())
virtual void addVariable(KDReports::VariableType variable)
virtual void addInlineElement(const Element &element)
void copyStateFrom(const ReportBuilder &parentBuilder)
@ Millimeters
Millimeters (the default)
KDREPORTS_EXPORT qreal mmToPixels(qreal mm)
Qt::AlignmentFlag m_align
KDReports::VariableType m_variableType