KD Reports API Documentation 2.2
Loading...
Searching...
No Matches
KDReportsHtmlElement.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 <QDebug>
14
15class KDReports::HtmlElementPrivate
16{
17public:
18 QString m_html;
19 QString m_id;
20};
21
23 : Element()
24 , d(new HtmlElementPrivate)
25{
26 d->m_html = html;
27}
28
30 : Element(other)
31 , d(new HtmlElementPrivate(*other.d))
32{
33}
34
36{
37 if (&other == this)
38 return *this;
39 Element::operator=(other);
40 *d = *other.d;
41 return *this;
42}
43
47
49{
50 QTextCursor &cursor = builder.cursor();
51 const int charPosition = cursor.position();
52 cursor.insertHtml(d->m_html);
53 if (!d->m_id.isEmpty())
54 builder.currentDocumentData().setTextValueMarker(charPosition, d->m_id, cursor.position(), false);
55}
56
58{
59 d->m_html.append(str);
60 return *this;
61}
62
64{
65 d->m_html = html;
66}
67
69{
70 return new HtmlElement(*this);
71}
72
74{
75 d->m_id = id;
76}
77
79{
80 return d->m_id;
81}
82
84{
85 return d->m_html;
86}
Element & operator=(const Element &other)
void build(ReportBuilder &builder) const override
void setHtml(const QString &html)
void setId(const QString &id)
HtmlElement & operator=(const HtmlElement &other)
Element * clone() const override
HtmlElement & operator<<(const QString &)
HtmlElement(const QString &html=QString())
TextDocumentData & currentDocumentData()
void setTextValueMarker(int pos, const QString &id, int valueLength, bool html)
void insertHtml(const QString &html)
int position() const const

© 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