KD Reports API Documentation 2.2
Loading...
Searching...
No Matches
KDReportsHLineElement.cpp
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Reports library.
4**
5** SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10
13#include "KDReportsLayoutHelper_p.h" // mmToPixels
15#include <QDebug>
16
17class KDReports::HLineElementPrivate
18{
19public:
20 QString m_id;
21 QColor m_color;
22
23 qreal m_thickness;
24 int m_margin;
25};
26
28 : Element()
29 , d(new HLineElementPrivate)
30{
31 d->m_color = Qt::gray;
32 d->m_thickness = 2;
33 d->m_margin = 6;
34}
35
37 : Element(other)
38 , d(new HLineElementPrivate(*other.d))
39{
40}
41
43{
44 if (&other == this)
45 return *this;
46 Element::operator=(other);
47 *d = *other.d;
48 return *this;
49}
50
54
56{
57 d->m_color = color;
58}
59
61{
62 return d->m_color;
63}
64
66{
67 d->m_thickness = t;
68}
69
71{
72 return d->m_thickness;
73}
74
76{
77 d->m_margin = m; // in mm
78}
79
81{
82 return d->m_margin;
83}
84
86{
87 QTextCursor &cursor = builder.cursor();
88
90
92 fmt.setProperty(HLineTextObject::Color, d->m_color);
93 fmt.setProperty(HLineTextObject::Thickness, d->m_thickness);
94 // qDebug() << "Setting Margin to" << d->m_margin << "mm" << mmToPixels( d->m_margin ) << "px";
95 fmt.setProperty(HLineTextObject::Margin, double(mmToPixels(d->m_margin)));
96
98}
99
101{
102 return new HLineElement(*this);
103}
Element & operator=(const Element &other)
void build(ReportBuilder &builder) const override
void setColor(const QColor &color)
HLineElement & operator=(const HLineElement &other)
Element * clone() const override
KDREPORTS_EXPORT qreal mmToPixels(qreal mm)
ObjectReplacementCharacter
void insertText(const QString &text)
void setObjectType(int type)
void setProperty(int propertyId, const QVariant &value)

© 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 Wed Apr 24 2024 04:08:14 for KD Reports API Documentation by doxygen 1.9.8