LibEngsas
echartbaseqml.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef ECHARTBASEQML_H
21 #define ECHARTBASEQML_H
22 
23 #include <qglobal.h>
24 
25 #if QT_VERSION >= 0x050000
26 #include <QQuickPaintedItem>
27 
28 class QPainter;
29 #else
30 #include <QGraphicsProxyWidget>
31 #endif
32 #include "echarts.h"
33 
34 class EChartBase;
35 
39 #if QT_VERSION >= 0x050000
40 class E_CHARTS_EXPORT EChartBaseQml : public QQuickPaintedItem
41 #else
42 class E_CHARTS_EXPORT EChartBaseQml : public QGraphicsProxyWidget
43 #endif
44 {
45  Q_OBJECT
46  Q_PROPERTY(QString chartTitle READ chartTitle WRITE setChartTitle)
47  Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision)
48  Q_PROPERTY(char numberFormat READ numberFormat WRITE setNumberFormat)
49  Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont)
50  Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
51  public:
52 #if QT_VERSION >= 0x050000
53  EChartBaseQml(EChartBase *eChartWidget, QQuickItem *parent = NULL);
54 #else
55  EChartBaseQml(EChartBase *eChartWidget, QGraphicsItem *parent = NULL);
56 #endif
57 
58  void setChartTitle(QString chartTitle);
59  QString chartTitle() const;
60  void setNumberPrecision(int precision);
61  int numberPrecision() const;
62  void setNumberFormat(char format);
63  char numberFormat() const;
64 
65 // void addDataSet(EChartValues dataSet, const QString label, QColor color = QColor());
66  bool removeDataSet(const QString label);
67 
68  void setTitleFont(QFont font);
69  QFont titleFont() const;
70  void setLabelFont(QFont font);
71  QFont labelFont() const;
72 
73 
74 #if QT_VERSION >= 0x050000
75  void paint(QPainter * painter);
76 #endif
77 
78  public slots:
79  void clear();
80 
81  protected:
83 };
84 
85 #endif // ECHARTBASEQML_H
The base QML export class for EChart widgets.
Definition: echartbaseqml.h:42
char numberFormat() const
void setNumberFormat(char format)
Definition: echartbaseqml.cpp:70
void setLabelFont(QFont font)
Definition: echartbaseqml.cpp:105
Base class for ECharts.To add values, call addDataSet(). How the values are treated or how many data ...
Definition: echartbase.h:56
void clear()
Definition: echartbaseqml.cpp:130
QFont labelFont() const
int numberPrecision() const
bool removeDataSet(const QString label)
Definition: echartbaseqml.cpp:84
EChartBase * eChartBase
Definition: echartbaseqml.h:82
void setTitleFont(QFont font)
Definition: echartbaseqml.cpp:91
QFont titleFont() const
#define E_CHARTS_EXPORT
Definition: echarts.h:31
void setChartTitle(QString chartTitle)
Definition: echartbaseqml.cpp:42
EChartBaseQml(EChartBase *eChartWidget, QGraphicsItem *parent=NULL)
Definition: echartbaseqml.cpp:29
void setNumberPrecision(int precision)
Definition: echartbaseqml.cpp:56
QString chartTitle() const