KD Reports  1.9
KDReportsImageElement.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 KDREPORTSIMAGEELEMENT_H
18 #define KDREPORTSIMAGEELEMENT_H
19 
20 #include "KDReportsElement.h"
21 #include "KDReportsUnit.h"
22 #include <QtCore/QtGlobal> // qreal
23 
24 QT_BEGIN_NAMESPACE
25 class QPixmap;
26 class QImage;
27 QT_END_NAMESPACE
28 
29 namespace KDReports {
30 class ImageElementPrivate;
31 
35 class KDREPORTS_EXPORT ImageElement : public Element
36 {
37 public:
42  explicit ImageElement( const QPixmap& pixmap );
48  explicit ImageElement( const QImage& image );
52  ~ImageElement() override;
53 
58  void setPixmap( const QPixmap& pixmap );
59 
64  QPixmap pixmap() const;
65 
70  void setImage( const QImage& image );
71 
76  QImage image() const;
77 
81  ImageElement(const ImageElement &other);
85  ImageElement &operator=(const ImageElement &other);
86 
103  void setWidth( qreal width, Unit unit = Millimeters );
104 
109  qreal width() const;
110 
117  void setHeight( qreal height, Unit unit = Millimeters );
118 
123  qreal height() const;
124 
129  Unit unit() const;
130 
135  void setUnit(Unit unit);
136 
143  void setFitToPage();
144 
149  bool fitToPage() const;
150 
155  void setId( const QString& id );
156 
161  QString id() const;
162 
167  void build( ReportBuilder& ) const override;
172  Element* clone() const override;
173 
174 private:
175  ImageElementPrivate* const d;
176 };
177 
178 }
179 
180 #endif /* KDREPORTSIMAGEELEMENT_H */
181 
Unit
Definition: KDReportsUnit.h:26
Definition: KDReportsImageElement.h:35
Millimeters (the default)
Definition: KDReportsUnit.h:27
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/