KD Reports  1.9
KDReportsTextElement.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDReports OR LicenseRef-KDAB-KDReports-US
8 **
9 ** Licensees holding valid commercial KD Reports licenses may use this file in
10 ** accordance with the KD Reports Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 
17 #ifndef KDREPORTSTEXTELEMENT_H
18 #define KDREPORTSTEXTELEMENT_H
19 
20 #include "KDReportsElement.h"
21 #include <QtCore/QString>
22 #include <QTextCharFormat>
23 
24 QT_BEGIN_NAMESPACE
25 class QColor;
26 class QFont;
27 QT_END_NAMESPACE
28 
29 namespace KDReports {
30 class TextElementPrivate;
31 
36 class KDREPORTS_EXPORT TextElement : public Element
37 {
38 public:
42  explicit TextElement( const QString& string = QString() );
46  ~TextElement() override;
47 
52  TextElement(const TextElement &other);
56  TextElement &operator=(const TextElement &other);
57 
61  void setText( const QString& text );
62 
66  TextElement& operator<<( const QString& );
67 
69  void setFontFamily( const QString& family );
71  void setBold( bool bold );
73  void setItalic( bool italic );
75  void setUnderline( bool underline );
77  void setStrikeOut( bool strikeout );
79  void setPointSize( qreal size );
80 
88  void setFont( const QFont& );
89 
94  QFont font() const;
95 
100  void setTextColor( const QColor& color );
101 
106  QColor textColor() const;
107 
112  void setId( const QString& id );
113 
118  QString id() const;
119 
124  QString text() const;
125 
130  void build( ReportBuilder& builder ) const override;
135  Element* clone() const override;
136 
137 private:
138 
139  friend class ReportBuilder;
140  void setCharFormat( const QTextCharFormat& format );
141 
142  TextElementPrivate* const d;
143 };
144 
145 }
146 
147 #endif /* KDREPORTSTEXTELEMENT_H */
Definition: KDReportsTextElement.h:36
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsElement.h:39

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/