KD Reports  1.5
 All Classes Namespaces Functions Enumerations Enumerator Pages
KDReportsChartElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2014 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 class QAbstractItemModel;
32 
33 namespace KDChart { class Chart; }
34 
35 namespace KDReports {
36 
41 class KDREPORTS_EXPORT ChartElement : public Element
42 {
43 public:
47  explicit ChartElement( QAbstractItemModel* tableModel );
48 
54  explicit ChartElement( const QString& modelKey );
55 
64  explicit ChartElement( KDChart::Chart* chart );
65 
69  virtual ~ChartElement();
70 
74  ChartElement(const ChartElement &other);
78  ChartElement &operator=(const ChartElement &other);
79 
89  void setChart( KDChart::Chart* chart );
90 
101  void setSize( qreal width, qreal height, Unit unit = Millimeters );
102 
107  QSizeF size() const;
108 
113  Unit unit() const;
114 
119  void setTableModel(QAbstractItemModel *tableModel);
120 
125  void setModelKey(const QString &modelKey);
126 
131  void build( ReportBuilder& ) const;
136  Element* clone() const;
137 
138 private:
139  class Private;
140  QSharedDataPointer<Private> d;
141 };
142 
143 }
144 
145 #endif /* KDREPORTSCHARTELEMENT_H */
Unit
Definition: KDReportsUnit.h:32
Millimeters (the default)
Definition: KDReportsUnit.h:33
Definition: KDReportsElement.h:41
Definition: KDReportsChartElement.h:41

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-reports/