KD Reports  1.8
KDReportsChartElement.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 KDREPORTSCHARTELEMENT_H
24 #define KDREPORTSCHARTELEMENT_H
25 
26 #include <QSharedDataPointer>
27 #include "KDReportsElement.h"
28 #include "KDReportsUnit.h"
29 #include <QtCore/QtGlobal> // qreal
30 #include <QSizeF>
31 
32 QT_BEGIN_NAMESPACE
33 class QAbstractItemModel;
34 QT_END_NAMESPACE
35 
36 namespace KDChart { class Chart; }
37 
38 namespace KDReports {
39 class ChartElementPrivate;
40 
45 class KDREPORTS_EXPORT ChartElement : public Element
46 {
47 public:
51  explicit ChartElement( QAbstractItemModel* tableModel );
52 
58  explicit ChartElement( const QString& modelKey );
59 
68  explicit ChartElement( KDChart::Chart* chart );
69 
73  virtual ~ChartElement();
74 
78  ChartElement(const ChartElement &other);
82  ChartElement &operator=(const ChartElement &other);
83 
93  void setChart( KDChart::Chart* chart );
94 
105  void setSize( qreal width, qreal height, Unit unit = Millimeters );
106 
111  QSizeF size() const;
112 
117  Unit unit() const;
118 
123  void setTableModel(QAbstractItemModel *tableModel);
124 
129  void setModelKey(const QString &modelKey);
130 
135  void build( ReportBuilder& ) const;
140  Element* clone() const;
141 
142 private:
143  QSharedDataPointer<ChartElementPrivate> d;
144 };
145 
146 }
147 
148 #endif /* KDREPORTSCHARTELEMENT_H */
Unit
Definition: KDReportsUnit.h:32
Definition: KDReportsChartElement.h:36
Millimeters (the default)
Definition: KDReportsUnit.h:33
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsElement.h:45
Definition: KDReportsChartElement.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/