KD Reports  1.8
KDReportsImageElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSIMAGEELEMENT_H
24 #define KDREPORTSIMAGEELEMENT_H
25 
26 #include "KDReportsElement.h"
27 #include "KDReportsUnit.h"
28 #include <QtCore/QtGlobal> // qreal
29 
30 QT_BEGIN_NAMESPACE
31 class QPixmap;
32 class QImage;
33 QT_END_NAMESPACE
34 
35 namespace KDReports {
36 class ImageElementPrivate;
37 
41 class KDREPORTS_EXPORT ImageElement : public Element
42 {
43 public:
48  explicit ImageElement( const QPixmap& pixmap );
54  explicit ImageElement( const QImage& image );
58  virtual ~ImageElement();
59 
64  void setPixmap( const QPixmap& pixmap );
65 
70  QPixmap pixmap() const;
71 
76  void setImage( const QImage& image );
77 
82  QImage image() const;
83 
87  ImageElement(const ImageElement &other);
91  ImageElement &operator=(const ImageElement &other);
92 
109  void setWidth( qreal width, Unit unit = Millimeters );
110 
115  qreal width() const;
116 
123  void setHeight( qreal height, Unit unit = Millimeters );
124 
129  qreal height() const;
130 
135  Unit unit() const;
136 
141  void setUnit(Unit unit);
142 
149  void setFitToPage();
150 
155  bool fitToPage() const;
156 
161  void setId( const QString& id );
162 
167  QString id() const;
168 
173  void build( ReportBuilder& ) const;
178  Element* clone() const;
179 
180 private:
181  ImageElementPrivate* const d;
182 };
183 
184 }
185 
186 #endif /* KDREPORTSIMAGEELEMENT_H */
187 
Unit
Definition: KDReportsUnit.h:32
Definition: KDReportsImageElement.h:41
Millimeters (the default)
Definition: KDReportsUnit.h:33
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsElement.h:45

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/