KD Reports  1.9
KDReportsChartElement.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 KDREPORTSCHARTELEMENT_H
18 #define KDREPORTSCHARTELEMENT_H
19 
20 #include <QSharedDataPointer>
21 #include "KDReportsElement.h"
22 #include "KDReportsUnit.h"
23 #include <QtCore/QtGlobal> // qreal
24 #include <QSizeF>
25 
26 QT_BEGIN_NAMESPACE
27 class QAbstractItemModel;
28 QT_END_NAMESPACE
29 
30 namespace KDChart { class Chart; }
31 
32 namespace KDReports {
33 class ChartElementPrivate;
34 
39 class KDREPORTS_EXPORT ChartElement : public Element
40 {
41 public:
45  explicit ChartElement( QAbstractItemModel* tableModel );
46 
52  explicit ChartElement( const QString& modelKey );
53 
62  explicit ChartElement( KDChart::Chart* chart );
63 
67  ~ChartElement() override;
68 
72  ChartElement(const ChartElement &other);
76  ChartElement &operator=(const ChartElement &other);
77 
87  void setChart( KDChart::Chart* chart );
88 
99  void setSize( qreal width, qreal height, Unit unit = Millimeters );
100 
105  QSizeF size() const;
106 
111  Unit unit() const;
112 
117  void setTableModel(QAbstractItemModel *tableModel);
118 
123  void setModelKey(const QString &modelKey);
124 
129  void build( ReportBuilder& ) const override;
134  Element* clone() const override;
135 
136 private:
137  QSharedDataPointer<ChartElementPrivate> d;
138 };
139 
140 }
141 
142 #endif /* KDREPORTSCHARTELEMENT_H */
Unit
Definition: KDReportsUnit.h:26
Definition: KDReportsChartElement.h:30
Millimeters (the default)
Definition: KDReportsUnit.h:27
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsElement.h:39
Definition: KDReportsChartElement.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/