##// END OF EJS Templates
Make public headers compile with -Wzero-as-null-pointer-constant...
Marc Mutz -
r2871:cf15f38aab8d
parent child
Show More
@@ -1,115 +1,115
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QAREASERIES_H
22 #ifndef QAREASERIES_H
23 #define QAREASERIES_H
23 #define QAREASERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QAbstractSeries>
26 #include <QtCharts/QAbstractSeries>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28 #include <QtGui/QBrush>
28 #include <QtGui/QBrush>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31 class QLineSeries;
31 class QLineSeries;
32 class QAreaSeriesPrivate;
32 class QAreaSeriesPrivate;
33
33
34 class QT_CHARTS_EXPORT QAreaSeries : public QAbstractSeries
34 class QT_CHARTS_EXPORT QAreaSeries : public QAbstractSeries
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37 Q_PROPERTY(QLineSeries *upperSeries READ upperSeries)
37 Q_PROPERTY(QLineSeries *upperSeries READ upperSeries)
38 Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries)
38 Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries)
39 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
39 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
40 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
40 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
41 Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged)
41 Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged)
42 Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged)
42 Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged)
43 Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged)
43 Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged)
44 Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged)
44 Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged)
45 Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged)
45 Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged)
46
46
47 public:
47 public:
48 explicit QAreaSeries(QObject *parent = 0);
48 explicit QAreaSeries(QObject *parent = Q_NULLPTR);
49 explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0);
49 explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = Q_NULLPTR);
50 ~QAreaSeries();
50 ~QAreaSeries();
51
51
52 public:
52 public:
53 QAbstractSeries::SeriesType type() const;
53 QAbstractSeries::SeriesType type() const;
54
54
55 void setUpperSeries(QLineSeries *series);
55 void setUpperSeries(QLineSeries *series);
56 QLineSeries *upperSeries() const;
56 QLineSeries *upperSeries() const;
57 void setLowerSeries(QLineSeries *series);
57 void setLowerSeries(QLineSeries *series);
58 QLineSeries *lowerSeries() const;
58 QLineSeries *lowerSeries() const;
59
59
60 void setPen(const QPen &pen);
60 void setPen(const QPen &pen);
61 QPen pen() const;
61 QPen pen() const;
62
62
63 void setBrush(const QBrush &brush);
63 void setBrush(const QBrush &brush);
64 QBrush brush() const;
64 QBrush brush() const;
65
65
66 void setColor(const QColor &color);
66 void setColor(const QColor &color);
67 QColor color() const;
67 QColor color() const;
68
68
69 void setBorderColor(const QColor &color);
69 void setBorderColor(const QColor &color);
70 QColor borderColor() const;
70 QColor borderColor() const;
71
71
72 void setPointsVisible(bool visible = true);
72 void setPointsVisible(bool visible = true);
73 bool pointsVisible() const;
73 bool pointsVisible() const;
74
74
75 void setPointLabelsFormat(const QString &format);
75 void setPointLabelsFormat(const QString &format);
76 QString pointLabelsFormat() const;
76 QString pointLabelsFormat() const;
77
77
78 void setPointLabelsVisible(bool visible = true);
78 void setPointLabelsVisible(bool visible = true);
79 bool pointLabelsVisible() const;
79 bool pointLabelsVisible() const;
80
80
81 void setPointLabelsFont(const QFont &font);
81 void setPointLabelsFont(const QFont &font);
82 QFont pointLabelsFont() const;
82 QFont pointLabelsFont() const;
83
83
84 void setPointLabelsColor(const QColor &color);
84 void setPointLabelsColor(const QColor &color);
85 QColor pointLabelsColor() const;
85 QColor pointLabelsColor() const;
86
86
87 void setPointLabelsClipping(bool enabled = true);
87 void setPointLabelsClipping(bool enabled = true);
88 bool pointLabelsClipping() const;
88 bool pointLabelsClipping() const;
89
89
90 Q_SIGNALS:
90 Q_SIGNALS:
91 void clicked(const QPointF &point);
91 void clicked(const QPointF &point);
92 void hovered(const QPointF &point, bool state);
92 void hovered(const QPointF &point, bool state);
93 void pressed(const QPointF &point);
93 void pressed(const QPointF &point);
94 void released(const QPointF &point);
94 void released(const QPointF &point);
95 void doubleClicked(const QPointF &point);
95 void doubleClicked(const QPointF &point);
96 void selected();
96 void selected();
97 void colorChanged(QColor color);
97 void colorChanged(QColor color);
98 void borderColorChanged(QColor color);
98 void borderColorChanged(QColor color);
99 void pointLabelsFormatChanged(const QString &format);
99 void pointLabelsFormatChanged(const QString &format);
100 void pointLabelsVisibilityChanged(bool visible);
100 void pointLabelsVisibilityChanged(bool visible);
101 void pointLabelsFontChanged(const QFont &font);
101 void pointLabelsFontChanged(const QFont &font);
102 void pointLabelsColorChanged(const QColor &color);
102 void pointLabelsColorChanged(const QColor &color);
103 void pointLabelsClippingChanged(bool clipping);
103 void pointLabelsClippingChanged(bool clipping);
104
104
105 private:
105 private:
106 Q_DECLARE_PRIVATE(QAreaSeries)
106 Q_DECLARE_PRIVATE(QAreaSeries)
107 Q_DISABLE_COPY(QAreaSeries)
107 Q_DISABLE_COPY(QAreaSeries)
108 friend class AreaLegendMarker;
108 friend class AreaLegendMarker;
109 friend class AreaChartItem;
109 friend class AreaChartItem;
110 friend class QAreaLegendMarkerPrivate;
110 friend class QAreaLegendMarkerPrivate;
111 };
111 };
112
112
113 QT_CHARTS_END_NAMESPACE
113 QT_CHARTS_END_NAMESPACE
114
114
115 #endif // QAREASERIES_H
115 #endif // QAREASERIES_H
@@ -1,82 +1,82
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBARCATEGORYAXIS_H
22 #ifndef QBARCATEGORYAXIS_H
23 #define QBARCATEGORYAXIS_H
23 #define QBARCATEGORYAXIS_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QBarCategoryAxisPrivate;
29 class QBarCategoryAxisPrivate;
30
30
31 class QT_CHARTS_EXPORT QBarCategoryAxis : public QAbstractAxis
31 class QT_CHARTS_EXPORT QBarCategoryAxis : public QAbstractAxis
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 Q_PROPERTY(QStringList categories READ categories WRITE setCategories NOTIFY categoriesChanged)
34 Q_PROPERTY(QStringList categories READ categories WRITE setCategories NOTIFY categoriesChanged)
35 Q_PROPERTY(QString min READ min WRITE setMin NOTIFY minChanged)
35 Q_PROPERTY(QString min READ min WRITE setMin NOTIFY minChanged)
36 Q_PROPERTY(QString max READ max WRITE setMax NOTIFY maxChanged)
36 Q_PROPERTY(QString max READ max WRITE setMax NOTIFY maxChanged)
37 Q_PROPERTY(int count READ count NOTIFY countChanged)
37 Q_PROPERTY(int count READ count NOTIFY countChanged)
38
38
39 public:
39 public:
40 explicit QBarCategoryAxis(QObject *parent = 0);
40 explicit QBarCategoryAxis(QObject *parent = Q_NULLPTR);
41 ~QBarCategoryAxis();
41 ~QBarCategoryAxis();
42
42
43 protected:
43 protected:
44 QBarCategoryAxis(QBarCategoryAxisPrivate &d, QObject *parent = 0);
44 QBarCategoryAxis(QBarCategoryAxisPrivate &d, QObject *parent = Q_NULLPTR);
45
45
46 public:
46 public:
47 AxisType type() const;
47 AxisType type() const;
48 void append(const QStringList &categories);
48 void append(const QStringList &categories);
49 void append(const QString &category);
49 void append(const QString &category);
50 void remove(const QString &category);
50 void remove(const QString &category);
51 void insert(int index, const QString &category);
51 void insert(int index, const QString &category);
52 void replace(const QString &oldCategory, const QString &newCategory);
52 void replace(const QString &oldCategory, const QString &newCategory);
53 Q_INVOKABLE void clear();
53 Q_INVOKABLE void clear();
54 void setCategories(const QStringList &categories);
54 void setCategories(const QStringList &categories);
55 QStringList categories();
55 QStringList categories();
56 int count() const;
56 int count() const;
57 QString at(int index) const;
57 QString at(int index) const;
58
58
59 //range handling
59 //range handling
60 void setMin(const QString &minCategory);
60 void setMin(const QString &minCategory);
61 QString min() const;
61 QString min() const;
62 void setMax(const QString &maxCategory);
62 void setMax(const QString &maxCategory);
63 QString max() const;
63 QString max() const;
64 void setRange(const QString &minCategory, const QString &maxCategory);
64 void setRange(const QString &minCategory, const QString &maxCategory);
65
65
66 Q_SIGNALS:
66 Q_SIGNALS:
67 void categoriesChanged();
67 void categoriesChanged();
68 void minChanged(const QString &min);
68 void minChanged(const QString &min);
69 void maxChanged(const QString &max);
69 void maxChanged(const QString &max);
70 void rangeChanged(const QString &min, const QString &max);
70 void rangeChanged(const QString &min, const QString &max);
71 void countChanged();
71 void countChanged();
72
72
73 private:
73 private:
74 Q_DECLARE_PRIVATE(QBarCategoryAxis)
74 Q_DECLARE_PRIVATE(QBarCategoryAxis)
75 Q_DISABLE_COPY(QBarCategoryAxis)
75 Q_DISABLE_COPY(QBarCategoryAxis)
76 friend class ChartBarCategoryAxisX;
76 friend class ChartBarCategoryAxisX;
77 friend class ChartBarCategoryAxisY;
77 friend class ChartBarCategoryAxisY;
78 };
78 };
79
79
80 QT_CHARTS_END_NAMESPACE
80 QT_CHARTS_END_NAMESPACE
81
81
82 #endif // QBARCATEGORYAXIS_H
82 #endif // QBARCATEGORYAXIS_H
@@ -1,83 +1,83
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QCATEGORYAXIS_H
22 #ifndef QCATEGORYAXIS_H
23 #define QCATEGORYAXIS_H
23 #define QCATEGORYAXIS_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26 #include <QtCharts/QValueAxis>
26 #include <QtCharts/QValueAxis>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29
29
30 class QCategoryAxisPrivate;
30 class QCategoryAxisPrivate;
31
31
32 class QT_CHARTS_EXPORT QCategoryAxis : public QValueAxis
32 class QT_CHARTS_EXPORT QCategoryAxis : public QValueAxis
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 Q_PROPERTY(qreal startValue READ startValue WRITE setStartValue)
35 Q_PROPERTY(qreal startValue READ startValue WRITE setStartValue)
36 Q_PROPERTY(int count READ count)
36 Q_PROPERTY(int count READ count)
37 Q_PROPERTY(QStringList categoriesLabels READ categoriesLabels)
37 Q_PROPERTY(QStringList categoriesLabels READ categoriesLabels)
38 Q_PROPERTY(AxisLabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged)
38 Q_PROPERTY(AxisLabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged)
39 Q_ENUMS(AxisLabelsPosition)
39 Q_ENUMS(AxisLabelsPosition)
40
40
41 public:
41 public:
42
42
43 enum AxisLabelsPosition {
43 enum AxisLabelsPosition {
44 AxisLabelsPositionCenter = 0x0,
44 AxisLabelsPositionCenter = 0x0,
45 AxisLabelsPositionOnValue = 0x1
45 AxisLabelsPositionOnValue = 0x1
46 };
46 };
47
47
48 explicit QCategoryAxis(QObject *parent = 0);
48 explicit QCategoryAxis(QObject *parent = Q_NULLPTR);
49 ~QCategoryAxis();
49 ~QCategoryAxis();
50
50
51 protected:
51 protected:
52 QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent = 0);
52 QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent = Q_NULLPTR);
53
53
54 public:
54 public:
55 AxisType type() const;
55 AxisType type() const;
56
56
57 void append(const QString &label, qreal categoryEndValue);
57 void append(const QString &label, qreal categoryEndValue);
58 void remove(const QString &label);
58 void remove(const QString &label);
59 void replaceLabel(const QString &oldLabel, const QString &newLabel);
59 void replaceLabel(const QString &oldLabel, const QString &newLabel);
60
60
61 qreal startValue(const QString &categoryLabel = QString()) const;
61 qreal startValue(const QString &categoryLabel = QString()) const;
62 void setStartValue(qreal min);
62 void setStartValue(qreal min);
63
63
64 qreal endValue(const QString &categoryLabel) const;
64 qreal endValue(const QString &categoryLabel) const;
65
65
66 QStringList categoriesLabels();
66 QStringList categoriesLabels();
67 int count() const;
67 int count() const;
68
68
69 QCategoryAxis::AxisLabelsPosition labelsPosition() const;
69 QCategoryAxis::AxisLabelsPosition labelsPosition() const;
70 void setLabelsPosition(QCategoryAxis::AxisLabelsPosition position);
70 void setLabelsPosition(QCategoryAxis::AxisLabelsPosition position);
71
71
72 Q_SIGNALS:
72 Q_SIGNALS:
73 void categoriesChanged();
73 void categoriesChanged();
74 void labelsPositionChanged(QCategoryAxis::AxisLabelsPosition position);
74 void labelsPositionChanged(QCategoryAxis::AxisLabelsPosition position);
75
75
76 private:
76 private:
77 Q_DECLARE_PRIVATE(QCategoryAxis)
77 Q_DECLARE_PRIVATE(QCategoryAxis)
78 Q_DISABLE_COPY(QCategoryAxis)
78 Q_DISABLE_COPY(QCategoryAxis)
79 };
79 };
80
80
81 QT_CHARTS_END_NAMESPACE
81 QT_CHARTS_END_NAMESPACE
82
82
83 #endif // QCATEGORYAXIS_H
83 #endif // QCATEGORYAXIS_H
@@ -1,81 +1,81
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QDATETIMEAXIS_H
22 #ifndef QDATETIMEAXIS_H
23 #define QDATETIMEAXIS_H
23 #define QDATETIMEAXIS_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26
26
27 QT_BEGIN_NAMESPACE
27 QT_BEGIN_NAMESPACE
28 class QDateTime;
28 class QDateTime;
29 QT_END_NAMESPACE
29 QT_END_NAMESPACE
30
30
31 QT_CHARTS_BEGIN_NAMESPACE
31 QT_CHARTS_BEGIN_NAMESPACE
32
32
33 class QDateTimeAxisPrivate;
33 class QDateTimeAxisPrivate;
34
34
35 class QT_CHARTS_EXPORT QDateTimeAxis : public QAbstractAxis
35 class QT_CHARTS_EXPORT QDateTimeAxis : public QAbstractAxis
36 {
36 {
37 Q_OBJECT
37 Q_OBJECT
38 Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged)
38 Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged)
39 Q_PROPERTY(QDateTime min READ min WRITE setMin NOTIFY minChanged)
39 Q_PROPERTY(QDateTime min READ min WRITE setMin NOTIFY minChanged)
40 Q_PROPERTY(QDateTime max READ max WRITE setMax NOTIFY maxChanged)
40 Q_PROPERTY(QDateTime max READ max WRITE setMax NOTIFY maxChanged)
41 Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged)
41 Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged)
42
42
43 public:
43 public:
44 explicit QDateTimeAxis(QObject *parent = 0);
44 explicit QDateTimeAxis(QObject *parent = Q_NULLPTR);
45 ~QDateTimeAxis();
45 ~QDateTimeAxis();
46
46
47 protected:
47 protected:
48 QDateTimeAxis(QDateTimeAxisPrivate &d, QObject *parent = 0);
48 QDateTimeAxis(QDateTimeAxisPrivate &d, QObject *parent = Q_NULLPTR);
49
49
50 public:
50 public:
51 AxisType type() const;
51 AxisType type() const;
52
52
53 //range handling
53 //range handling
54 void setMin(QDateTime min);
54 void setMin(QDateTime min);
55 QDateTime min() const;
55 QDateTime min() const;
56 void setMax(QDateTime max);
56 void setMax(QDateTime max);
57 QDateTime max() const;
57 QDateTime max() const;
58 void setRange(QDateTime min, QDateTime max);
58 void setRange(QDateTime min, QDateTime max);
59
59
60 void setFormat(QString format);
60 void setFormat(QString format);
61 QString format() const;
61 QString format() const;
62
62
63 //ticks handling
63 //ticks handling
64 void setTickCount(int count);
64 void setTickCount(int count);
65 int tickCount() const;
65 int tickCount() const;
66
66
67 Q_SIGNALS:
67 Q_SIGNALS:
68 void minChanged(QDateTime min);
68 void minChanged(QDateTime min);
69 void maxChanged(QDateTime max);
69 void maxChanged(QDateTime max);
70 void rangeChanged(QDateTime min, QDateTime max);
70 void rangeChanged(QDateTime min, QDateTime max);
71 void formatChanged(QString format);
71 void formatChanged(QString format);
72 void tickCountChanged(int tick);
72 void tickCountChanged(int tick);
73
73
74 private:
74 private:
75 Q_DECLARE_PRIVATE(QDateTimeAxis)
75 Q_DECLARE_PRIVATE(QDateTimeAxis)
76 Q_DISABLE_COPY(QDateTimeAxis)
76 Q_DISABLE_COPY(QDateTimeAxis)
77 };
77 };
78
78
79 QT_CHARTS_END_NAMESPACE
79 QT_CHARTS_END_NAMESPACE
80
80
81 #endif // QDATETIMEAXIS_H
81 #endif // QDATETIMEAXIS_H
@@ -1,80 +1,80
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QLOGVALUEAXIS_H
22 #ifndef QLOGVALUEAXIS_H
23 #define QLOGVALUEAXIS_H
23 #define QLOGVALUEAXIS_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26
26
27 QT_BEGIN_NAMESPACE
27 QT_BEGIN_NAMESPACE
28 class QDateTime;
28 class QDateTime;
29 QT_END_NAMESPACE
29 QT_END_NAMESPACE
30
30
31 QT_CHARTS_BEGIN_NAMESPACE
31 QT_CHARTS_BEGIN_NAMESPACE
32
32
33 class QLogValueAxisPrivate;
33 class QLogValueAxisPrivate;
34
34
35 class QT_CHARTS_EXPORT QLogValueAxis : public QAbstractAxis
35 class QT_CHARTS_EXPORT QLogValueAxis : public QAbstractAxis
36 {
36 {
37 Q_OBJECT
37 Q_OBJECT
38 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
38 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
39 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
39 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
40 Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged)
40 Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged)
41 Q_PROPERTY(qreal base READ base WRITE setBase NOTIFY baseChanged)
41 Q_PROPERTY(qreal base READ base WRITE setBase NOTIFY baseChanged)
42
42
43 public:
43 public:
44 explicit QLogValueAxis(QObject *parent = 0);
44 explicit QLogValueAxis(QObject *parent = Q_NULLPTR);
45 ~QLogValueAxis();
45 ~QLogValueAxis();
46
46
47 protected:
47 protected:
48 QLogValueAxis(QLogValueAxisPrivate &d, QObject *parent = 0);
48 QLogValueAxis(QLogValueAxisPrivate &d, QObject *parent = Q_NULLPTR);
49
49
50 public:
50 public:
51 AxisType type() const;
51 AxisType type() const;
52
52
53 //range handling
53 //range handling
54 void setMin(qreal min);
54 void setMin(qreal min);
55 qreal min() const;
55 qreal min() const;
56 void setMax(qreal max);
56 void setMax(qreal max);
57 qreal max() const;
57 qreal max() const;
58 void setRange(qreal min, qreal max);
58 void setRange(qreal min, qreal max);
59
59
60 void setLabelFormat(const QString &format);
60 void setLabelFormat(const QString &format);
61 QString labelFormat() const;
61 QString labelFormat() const;
62
62
63 void setBase(qreal base);
63 void setBase(qreal base);
64 qreal base() const;
64 qreal base() const;
65
65
66 Q_SIGNALS:
66 Q_SIGNALS:
67 void minChanged(qreal min);
67 void minChanged(qreal min);
68 void maxChanged(qreal max);
68 void maxChanged(qreal max);
69 void rangeChanged(qreal min, qreal max);
69 void rangeChanged(qreal min, qreal max);
70 void labelFormatChanged(const QString &format);
70 void labelFormatChanged(const QString &format);
71 void baseChanged(qreal base);
71 void baseChanged(qreal base);
72
72
73 private:
73 private:
74 Q_DECLARE_PRIVATE(QLogValueAxis)
74 Q_DECLARE_PRIVATE(QLogValueAxis)
75 Q_DISABLE_COPY(QLogValueAxis)
75 Q_DISABLE_COPY(QLogValueAxis)
76 };
76 };
77
77
78 QT_CHARTS_END_NAMESPACE
78 QT_CHARTS_END_NAMESPACE
79
79
80 #endif // QLOGVALUEAXIS_H
80 #endif // QLOGVALUEAXIS_H
@@ -1,210 +1,210
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QABSTRACTAXIS_H
22 #ifndef QABSTRACTAXIS_H
23 #define QABSTRACTAXIS_H
23 #define QABSTRACTAXIS_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtGui/QPen>
26 #include <QtGui/QPen>
27 #include <QtGui/QFont>
27 #include <QtGui/QFont>
28 #include <QtCore/QVariant>
28 #include <QtCore/QVariant>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31
31
32 class QAbstractAxisPrivate;
32 class QAbstractAxisPrivate;
33
33
34 class QT_CHARTS_EXPORT QAbstractAxis : public QObject
34 class QT_CHARTS_EXPORT QAbstractAxis : public QObject
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37 //visibility
37 //visibility
38 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
38 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
39 //arrow
39 //arrow
40 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
40 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
41 Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged)
41 Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged)
42 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
42 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
43 //labels
43 //labels
44 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
44 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
45 Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged)
45 Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged)
46 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
46 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
47 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
47 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
48 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
48 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
49 //grid
49 //grid
50 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
50 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
51 Q_PROPERTY(QPen gridLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged)
51 Q_PROPERTY(QPen gridLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged)
52 Q_PROPERTY(bool minorGridVisible READ isMinorGridLineVisible WRITE setMinorGridLineVisible NOTIFY minorGridVisibleChanged)
52 Q_PROPERTY(bool minorGridVisible READ isMinorGridLineVisible WRITE setMinorGridLineVisible NOTIFY minorGridVisibleChanged)
53 Q_PROPERTY(QPen minorGridLinePen READ minorGridLinePen WRITE setMinorGridLinePen NOTIFY minorGridLinePenChanged)
53 Q_PROPERTY(QPen minorGridLinePen READ minorGridLinePen WRITE setMinorGridLinePen NOTIFY minorGridLinePenChanged)
54 Q_PROPERTY(QColor gridLineColor READ gridLineColor WRITE setGridLineColor NOTIFY gridLineColorChanged)
54 Q_PROPERTY(QColor gridLineColor READ gridLineColor WRITE setGridLineColor NOTIFY gridLineColorChanged)
55 Q_PROPERTY(QColor minorGridLineColor READ minorGridLineColor WRITE setMinorGridLineColor NOTIFY minorGridLineColorChanged)
55 Q_PROPERTY(QColor minorGridLineColor READ minorGridLineColor WRITE setMinorGridLineColor NOTIFY minorGridLineColorChanged)
56 //shades
56 //shades
57 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
57 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
58 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
58 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
59 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
59 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
60 Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged)
60 Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged)
61 Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged)
61 Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged)
62 //title
62 //title
63 Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged)
63 Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged)
64 Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged)
64 Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged)
65 Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged)
65 Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged)
66 Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged)
66 Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged)
67 //orientation
67 //orientation
68 Q_PROPERTY(Qt::Orientation orientation READ orientation)
68 Q_PROPERTY(Qt::Orientation orientation READ orientation)
69 //aligment
69 //aligment
70 Q_PROPERTY(Qt::Alignment alignment READ alignment)
70 Q_PROPERTY(Qt::Alignment alignment READ alignment)
71 Q_PROPERTY(bool reverse READ isReverse WRITE setReverse NOTIFY reverseChanged)
71 Q_PROPERTY(bool reverse READ isReverse WRITE setReverse NOTIFY reverseChanged)
72
72
73 public:
73 public:
74
74
75 enum AxisType {
75 enum AxisType {
76 AxisTypeNoAxis = 0x0,
76 AxisTypeNoAxis = 0x0,
77 AxisTypeValue = 0x1,
77 AxisTypeValue = 0x1,
78 AxisTypeBarCategory = 0x2,
78 AxisTypeBarCategory = 0x2,
79 AxisTypeCategory = 0x4,
79 AxisTypeCategory = 0x4,
80 AxisTypeDateTime = 0x8,
80 AxisTypeDateTime = 0x8,
81 AxisTypeLogValue = 0x10
81 AxisTypeLogValue = 0x10
82 };
82 };
83
83
84 Q_DECLARE_FLAGS(AxisTypes, AxisType)
84 Q_DECLARE_FLAGS(AxisTypes, AxisType)
85
85
86 protected:
86 protected:
87 explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0);
87 explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = Q_NULLPTR);
88
88
89 public:
89 public:
90 ~QAbstractAxis();
90 ~QAbstractAxis();
91
91
92 virtual AxisType type() const = 0;
92 virtual AxisType type() const = 0;
93
93
94 //visibility handling
94 //visibility handling
95 bool isVisible() const;
95 bool isVisible() const;
96 void setVisible(bool visible = true);
96 void setVisible(bool visible = true);
97 void show();
97 void show();
98 void hide();
98 void hide();
99
99
100 //arrow handling
100 //arrow handling
101 bool isLineVisible() const;
101 bool isLineVisible() const;
102 void setLineVisible(bool visible = true);
102 void setLineVisible(bool visible = true);
103 void setLinePen(const QPen &pen);
103 void setLinePen(const QPen &pen);
104 QPen linePen() const;
104 QPen linePen() const;
105 void setLinePenColor(QColor color);
105 void setLinePenColor(QColor color);
106 QColor linePenColor() const;
106 QColor linePenColor() const;
107
107
108 //grid handling
108 //grid handling
109 bool isGridLineVisible() const;
109 bool isGridLineVisible() const;
110 void setGridLineVisible(bool visible = true);
110 void setGridLineVisible(bool visible = true);
111 void setGridLinePen(const QPen &pen);
111 void setGridLinePen(const QPen &pen);
112 QPen gridLinePen() const;
112 QPen gridLinePen() const;
113 bool isMinorGridLineVisible() const;
113 bool isMinorGridLineVisible() const;
114 void setMinorGridLineVisible(bool visible = true);
114 void setMinorGridLineVisible(bool visible = true);
115 void setMinorGridLinePen(const QPen &pen);
115 void setMinorGridLinePen(const QPen &pen);
116 QPen minorGridLinePen() const;
116 QPen minorGridLinePen() const;
117 void setGridLineColor(const QColor &color);
117 void setGridLineColor(const QColor &color);
118 QColor gridLineColor();
118 QColor gridLineColor();
119 void setMinorGridLineColor(const QColor &color);
119 void setMinorGridLineColor(const QColor &color);
120 QColor minorGridLineColor();
120 QColor minorGridLineColor();
121
121
122 //labels handling
122 //labels handling
123 bool labelsVisible() const;
123 bool labelsVisible() const;
124 void setLabelsVisible(bool visible = true);
124 void setLabelsVisible(bool visible = true);
125 void setLabelsBrush(const QBrush &brush);
125 void setLabelsBrush(const QBrush &brush);
126 QBrush labelsBrush() const;
126 QBrush labelsBrush() const;
127 void setLabelsFont(const QFont &font);
127 void setLabelsFont(const QFont &font);
128 QFont labelsFont() const;
128 QFont labelsFont() const;
129 void setLabelsAngle(int angle);
129 void setLabelsAngle(int angle);
130 int labelsAngle() const;
130 int labelsAngle() const;
131 void setLabelsColor(QColor color);
131 void setLabelsColor(QColor color);
132 QColor labelsColor() const;
132 QColor labelsColor() const;
133
133
134 //title handling
134 //title handling
135 bool isTitleVisible() const;
135 bool isTitleVisible() const;
136 void setTitleVisible(bool visible = true);
136 void setTitleVisible(bool visible = true);
137 void setTitleBrush(const QBrush &brush);
137 void setTitleBrush(const QBrush &brush);
138 QBrush titleBrush() const;
138 QBrush titleBrush() const;
139 void setTitleFont(const QFont &font);
139 void setTitleFont(const QFont &font);
140 QFont titleFont() const;
140 QFont titleFont() const;
141 void setTitleText(const QString &title);
141 void setTitleText(const QString &title);
142 QString titleText() const;
142 QString titleText() const;
143
143
144 //shades handling
144 //shades handling
145 bool shadesVisible() const;
145 bool shadesVisible() const;
146 void setShadesVisible(bool visible = true);
146 void setShadesVisible(bool visible = true);
147 void setShadesPen(const QPen &pen);
147 void setShadesPen(const QPen &pen);
148 QPen shadesPen() const;
148 QPen shadesPen() const;
149 void setShadesBrush(const QBrush &brush);
149 void setShadesBrush(const QBrush &brush);
150 QBrush shadesBrush() const;
150 QBrush shadesBrush() const;
151 void setShadesColor(QColor color);
151 void setShadesColor(QColor color);
152 QColor shadesColor() const;
152 QColor shadesColor() const;
153 void setShadesBorderColor(QColor color);
153 void setShadesBorderColor(QColor color);
154 QColor shadesBorderColor() const;
154 QColor shadesBorderColor() const;
155
155
156 Qt::Orientation orientation() const;
156 Qt::Orientation orientation() const;
157 Qt::Alignment alignment() const;
157 Qt::Alignment alignment() const;
158
158
159 //range handling
159 //range handling
160 void setMin(const QVariant &min);
160 void setMin(const QVariant &min);
161 void setMax(const QVariant &max);
161 void setMax(const QVariant &max);
162 void setRange(const QVariant &min, const QVariant &max);
162 void setRange(const QVariant &min, const QVariant &max);
163
163
164 //reverse handling
164 //reverse handling
165 void setReverse(bool reverse = true);
165 void setReverse(bool reverse = true);
166 bool isReverse() const;
166 bool isReverse() const;
167
167
168 Q_SIGNALS:
168 Q_SIGNALS:
169 void visibleChanged(bool visible);
169 void visibleChanged(bool visible);
170 void linePenChanged(const QPen &pen);
170 void linePenChanged(const QPen &pen);
171 void lineVisibleChanged(bool visible);
171 void lineVisibleChanged(bool visible);
172 void labelsVisibleChanged(bool visible);
172 void labelsVisibleChanged(bool visible);
173 void labelsBrushChanged(const QBrush &brush);
173 void labelsBrushChanged(const QBrush &brush);
174 void labelsFontChanged(const QFont &pen);
174 void labelsFontChanged(const QFont &pen);
175 void labelsAngleChanged(int angle);
175 void labelsAngleChanged(int angle);
176 void gridLinePenChanged(const QPen &pen);
176 void gridLinePenChanged(const QPen &pen);
177 void gridVisibleChanged(bool visible);
177 void gridVisibleChanged(bool visible);
178 void minorGridVisibleChanged(bool visible);
178 void minorGridVisibleChanged(bool visible);
179 void minorGridLinePenChanged(const QPen &pen);
179 void minorGridLinePenChanged(const QPen &pen);
180 void gridLineColorChanged(const QColor &color);
180 void gridLineColorChanged(const QColor &color);
181 void minorGridLineColorChanged(const QColor &color);
181 void minorGridLineColorChanged(const QColor &color);
182 void colorChanged(QColor color);
182 void colorChanged(QColor color);
183 void labelsColorChanged(QColor color);
183 void labelsColorChanged(QColor color);
184 void titleTextChanged(const QString &title);
184 void titleTextChanged(const QString &title);
185 void titleBrushChanged(const QBrush &brush);
185 void titleBrushChanged(const QBrush &brush);
186 void titleVisibleChanged(bool visible);
186 void titleVisibleChanged(bool visible);
187 void titleFontChanged(const QFont &font);
187 void titleFontChanged(const QFont &font);
188 void shadesVisibleChanged(bool visible);
188 void shadesVisibleChanged(bool visible);
189 void shadesColorChanged(QColor color);
189 void shadesColorChanged(QColor color);
190 void shadesBorderColorChanged(QColor color);
190 void shadesBorderColorChanged(QColor color);
191 void shadesPenChanged(const QPen &pen);
191 void shadesPenChanged(const QPen &pen);
192 void shadesBrushChanged(const QBrush &brush);
192 void shadesBrushChanged(const QBrush &brush);
193 void reverseChanged(bool reverse);
193 void reverseChanged(bool reverse);
194
194
195 protected:
195 protected:
196 QScopedPointer<QAbstractAxisPrivate> d_ptr;
196 QScopedPointer<QAbstractAxisPrivate> d_ptr;
197 friend class ChartDataSet;
197 friend class ChartDataSet;
198 friend class ChartPresenter;
198 friend class ChartPresenter;
199 friend class ChartThemeManager;
199 friend class ChartThemeManager;
200 friend class AbstractDomain;
200 friend class AbstractDomain;
201 friend class ChartAxisElement;
201 friend class ChartAxisElement;
202 friend class XYChart;
202 friend class XYChart;
203
203
204 private:
204 private:
205 Q_DISABLE_COPY(QAbstractAxis)
205 Q_DISABLE_COPY(QAbstractAxis)
206 };
206 };
207
207
208 QT_CHARTS_END_NAMESPACE
208 QT_CHARTS_END_NAMESPACE
209
209
210 #endif // QABSTRACTAXIS_H
210 #endif // QABSTRACTAXIS_H
@@ -1,84 +1,84
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QVALUEAXIS_H
22 #ifndef QVALUEAXIS_H
23 #define QVALUEAXIS_H
23 #define QVALUEAXIS_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QValueAxisPrivate;
29 class QValueAxisPrivate;
30
30
31 class QT_CHARTS_EXPORT QValueAxis : public QAbstractAxis
31 class QT_CHARTS_EXPORT QValueAxis : public QAbstractAxis
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged)
34 Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged)
35 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
35 Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged)
36 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
36 Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged)
37 Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged)
37 Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged)
38 Q_PROPERTY(int minorTickCount READ minorTickCount WRITE setMinorTickCount NOTIFY minorTickCountChanged)
38 Q_PROPERTY(int minorTickCount READ minorTickCount WRITE setMinorTickCount NOTIFY minorTickCountChanged)
39
39
40 public:
40 public:
41 explicit QValueAxis(QObject *parent = 0);
41 explicit QValueAxis(QObject *parent = Q_NULLPTR);
42 ~QValueAxis();
42 ~QValueAxis();
43
43
44 protected:
44 protected:
45 QValueAxis(QValueAxisPrivate &d, QObject *parent = 0);
45 QValueAxis(QValueAxisPrivate &d, QObject *parent = Q_NULLPTR);
46
46
47 public:
47 public:
48 AxisType type() const;
48 AxisType type() const;
49
49
50 //range handling
50 //range handling
51 void setMin(qreal min);
51 void setMin(qreal min);
52 qreal min() const;
52 qreal min() const;
53 void setMax(qreal max);
53 void setMax(qreal max);
54 qreal max() const;
54 qreal max() const;
55 void setRange(qreal min, qreal max);
55 void setRange(qreal min, qreal max);
56
56
57 //ticks handling
57 //ticks handling
58 void setTickCount(int count);
58 void setTickCount(int count);
59 int tickCount() const;
59 int tickCount() const;
60 void setMinorTickCount(int count);
60 void setMinorTickCount(int count);
61 int minorTickCount() const;
61 int minorTickCount() const;
62
62
63 void setLabelFormat(const QString &format);
63 void setLabelFormat(const QString &format);
64 QString labelFormat() const;
64 QString labelFormat() const;
65
65
66 public Q_SLOTS:
66 public Q_SLOTS:
67 void applyNiceNumbers();
67 void applyNiceNumbers();
68
68
69 Q_SIGNALS:
69 Q_SIGNALS:
70 void minChanged(qreal min);
70 void minChanged(qreal min);
71 void maxChanged(qreal max);
71 void maxChanged(qreal max);
72 void rangeChanged(qreal min, qreal max);
72 void rangeChanged(qreal min, qreal max);
73 void tickCountChanged(int tickCount);
73 void tickCountChanged(int tickCount);
74 void minorTickCountChanged(int tickCount);
74 void minorTickCountChanged(int tickCount);
75 void labelFormatChanged(const QString &format);
75 void labelFormatChanged(const QString &format);
76
76
77 private:
77 private:
78 Q_DECLARE_PRIVATE(QValueAxis)
78 Q_DECLARE_PRIVATE(QValueAxis)
79 Q_DISABLE_COPY(QValueAxis)
79 Q_DISABLE_COPY(QValueAxis)
80 };
80 };
81
81
82 QT_CHARTS_END_NAMESPACE
82 QT_CHARTS_END_NAMESPACE
83
83
84 #endif // QVALUEAXIS_H
84 #endif // QVALUEAXIS_H
@@ -1,46 +1,46
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHORIZONTALBARSERIES_H
22 #ifndef QHORIZONTALBARSERIES_H
23 #define QHORIZONTALBARSERIES_H
23 #define QHORIZONTALBARSERIES_H
24
24
25 #include <QtCharts/QAbstractBarSeries>
25 #include <QtCharts/QAbstractBarSeries>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QHorizontalBarSeriesPrivate;
29 class QHorizontalBarSeriesPrivate;
30
30
31 class QT_CHARTS_EXPORT QHorizontalBarSeries : public QAbstractBarSeries
31 class QT_CHARTS_EXPORT QHorizontalBarSeries : public QAbstractBarSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 public:
34 public:
35 explicit QHorizontalBarSeries(QObject *parent = 0);
35 explicit QHorizontalBarSeries(QObject *parent = Q_NULLPTR);
36 ~QHorizontalBarSeries();
36 ~QHorizontalBarSeries();
37 QAbstractSeries::SeriesType type() const;
37 QAbstractSeries::SeriesType type() const;
38
38
39 private:
39 private:
40 Q_DECLARE_PRIVATE(QHorizontalBarSeries)
40 Q_DECLARE_PRIVATE(QHorizontalBarSeries)
41 Q_DISABLE_COPY(QHorizontalBarSeries)
41 Q_DISABLE_COPY(QHorizontalBarSeries)
42 };
42 };
43
43
44 QT_CHARTS_END_NAMESPACE
44 QT_CHARTS_END_NAMESPACE
45
45
46 #endif // QHORIZONTALBARSERIES_H
46 #endif // QHORIZONTALBARSERIES_H
@@ -1,46 +1,46
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHORIZONTALPERCENTBARSERIES_H
22 #ifndef QHORIZONTALPERCENTBARSERIES_H
23 #define QHORIZONTALPERCENTBARSERIES_H
23 #define QHORIZONTALPERCENTBARSERIES_H
24
24
25 #include <QtCharts/QAbstractBarSeries>
25 #include <QtCharts/QAbstractBarSeries>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QHorizontalPercentBarSeriesPrivate;
29 class QHorizontalPercentBarSeriesPrivate;
30
30
31 class QT_CHARTS_EXPORT QHorizontalPercentBarSeries : public QAbstractBarSeries
31 class QT_CHARTS_EXPORT QHorizontalPercentBarSeries : public QAbstractBarSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 public:
34 public:
35 explicit QHorizontalPercentBarSeries(QObject *parent = 0);
35 explicit QHorizontalPercentBarSeries(QObject *parent = Q_NULLPTR);
36 ~QHorizontalPercentBarSeries();
36 ~QHorizontalPercentBarSeries();
37 QAbstractSeries::SeriesType type() const;
37 QAbstractSeries::SeriesType type() const;
38
38
39 private:
39 private:
40 Q_DECLARE_PRIVATE(QHorizontalPercentBarSeries)
40 Q_DECLARE_PRIVATE(QHorizontalPercentBarSeries)
41 Q_DISABLE_COPY(QHorizontalPercentBarSeries)
41 Q_DISABLE_COPY(QHorizontalPercentBarSeries)
42 };
42 };
43
43
44 QT_CHARTS_END_NAMESPACE
44 QT_CHARTS_END_NAMESPACE
45
45
46 #endif // QHORIZONTALPERCENTBARSERIES_H
46 #endif // QHORIZONTALPERCENTBARSERIES_H
@@ -1,46 +1,46
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHORIZONTALSTACKEDBARSERIES_H
22 #ifndef QHORIZONTALSTACKEDBARSERIES_H
23 #define QHORIZONTALSTACKEDBARSERIES_H
23 #define QHORIZONTALSTACKEDBARSERIES_H
24
24
25 #include <QtCharts/QAbstractBarSeries>
25 #include <QtCharts/QAbstractBarSeries>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QHorizontalStackedBarSeriesPrivate;
29 class QHorizontalStackedBarSeriesPrivate;
30
30
31 class QT_CHARTS_EXPORT QHorizontalStackedBarSeries : public QAbstractBarSeries
31 class QT_CHARTS_EXPORT QHorizontalStackedBarSeries : public QAbstractBarSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 public:
34 public:
35 explicit QHorizontalStackedBarSeries(QObject *parent = 0);
35 explicit QHorizontalStackedBarSeries(QObject *parent = Q_NULLPTR);
36 ~QHorizontalStackedBarSeries();
36 ~QHorizontalStackedBarSeries();
37 QAbstractSeries::SeriesType type() const;
37 QAbstractSeries::SeriesType type() const;
38
38
39 private:
39 private:
40 Q_DECLARE_PRIVATE(QHorizontalStackedBarSeries)
40 Q_DECLARE_PRIVATE(QHorizontalStackedBarSeries)
41 Q_DISABLE_COPY(QHorizontalStackedBarSeries)
41 Q_DISABLE_COPY(QHorizontalStackedBarSeries)
42 };
42 };
43
43
44 QT_CHARTS_END_NAMESPACE
44 QT_CHARTS_END_NAMESPACE
45
45
46 #endif // QHORIZONTALSTACKEDBARSERIES_H
46 #endif // QHORIZONTALSTACKEDBARSERIES_H
@@ -1,113 +1,113
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QABSTRACTBARSERIES_H
22 #ifndef QABSTRACTBARSERIES_H
23 #define QABSTRACTBARSERIES_H
23 #define QABSTRACTBARSERIES_H
24
24
25 #include <QtCharts/QAbstractSeries>
25 #include <QtCharts/QAbstractSeries>
26 #include <QtCore/QStringList>
26 #include <QtCore/QStringList>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29
29
30 class QBarSet;
30 class QBarSet;
31 class QAbstractBarSeriesPrivate;
31 class QAbstractBarSeriesPrivate;
32
32
33 // Container for series
33 // Container for series
34 class QT_CHARTS_EXPORT QAbstractBarSeries : public QAbstractSeries
34 class QT_CHARTS_EXPORT QAbstractBarSeries : public QAbstractSeries
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37 Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth)
37 Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth)
38 Q_PROPERTY(int count READ count NOTIFY countChanged)
38 Q_PROPERTY(int count READ count NOTIFY countChanged)
39 Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
39 Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
40 Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat NOTIFY labelsFormatChanged)
40 Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat NOTIFY labelsFormatChanged)
41 Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged)
41 Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged)
42 Q_PROPERTY(qreal labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
42 Q_PROPERTY(qreal labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
43 Q_ENUMS(LabelsPosition)
43 Q_ENUMS(LabelsPosition)
44
44
45 public:
45 public:
46 enum LabelsPosition {
46 enum LabelsPosition {
47 LabelsCenter = 0,
47 LabelsCenter = 0,
48 LabelsInsideEnd,
48 LabelsInsideEnd,
49 LabelsInsideBase,
49 LabelsInsideBase,
50 LabelsOutsideEnd
50 LabelsOutsideEnd
51 };
51 };
52
52
53 public:
53 public:
54 virtual ~QAbstractBarSeries();
54 virtual ~QAbstractBarSeries();
55
55
56 void setBarWidth(qreal width);
56 void setBarWidth(qreal width);
57 qreal barWidth() const;
57 qreal barWidth() const;
58
58
59 bool append(QBarSet *set);
59 bool append(QBarSet *set);
60 bool remove(QBarSet *set);
60 bool remove(QBarSet *set);
61 bool take(QBarSet *set);
61 bool take(QBarSet *set);
62 bool append(QList<QBarSet *> sets);
62 bool append(QList<QBarSet *> sets);
63 bool insert(int index, QBarSet *set);
63 bool insert(int index, QBarSet *set);
64 int count() const;
64 int count() const;
65 QList<QBarSet *> barSets() const;
65 QList<QBarSet *> barSets() const;
66 void clear();
66 void clear();
67
67
68 void setLabelsVisible(bool visible = true);
68 void setLabelsVisible(bool visible = true);
69 bool isLabelsVisible() const;
69 bool isLabelsVisible() const;
70
70
71 void setLabelsFormat(const QString &format);
71 void setLabelsFormat(const QString &format);
72 QString labelsFormat() const;
72 QString labelsFormat() const;
73
73
74 void setLabelsAngle(qreal angle);
74 void setLabelsAngle(qreal angle);
75 qreal labelsAngle() const;
75 qreal labelsAngle() const;
76
76
77 void setLabelsPosition(QAbstractBarSeries::LabelsPosition position);
77 void setLabelsPosition(QAbstractBarSeries::LabelsPosition position);
78 QAbstractBarSeries::LabelsPosition labelsPosition() const;
78 QAbstractBarSeries::LabelsPosition labelsPosition() const;
79
79
80 protected:
80 protected:
81 explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = 0);
81 explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = Q_NULLPTR);
82
82
83 Q_SIGNALS:
83 Q_SIGNALS:
84 void clicked(int index, QBarSet *barset);
84 void clicked(int index, QBarSet *barset);
85 void hovered(bool status, int index, QBarSet *barset);
85 void hovered(bool status, int index, QBarSet *barset);
86 void pressed(int index, QBarSet *barset);
86 void pressed(int index, QBarSet *barset);
87 void released(int index, QBarSet *barset);
87 void released(int index, QBarSet *barset);
88 void doubleClicked(int index, QBarSet *barset);
88 void doubleClicked(int index, QBarSet *barset);
89 void countChanged();
89 void countChanged();
90 void labelsVisibleChanged();
90 void labelsVisibleChanged();
91 void labelsFormatChanged(const QString &format);
91 void labelsFormatChanged(const QString &format);
92 void labelsPositionChanged(QAbstractBarSeries::LabelsPosition position);
92 void labelsPositionChanged(QAbstractBarSeries::LabelsPosition position);
93 void labelsAngleChanged(qreal angle);
93 void labelsAngleChanged(qreal angle);
94
94
95 void barsetsAdded(QList<QBarSet *> sets);
95 void barsetsAdded(QList<QBarSet *> sets);
96 void barsetsRemoved(QList<QBarSet *> sets);
96 void barsetsRemoved(QList<QBarSet *> sets);
97
97
98 protected:
98 protected:
99 Q_DECLARE_PRIVATE(QAbstractBarSeries)
99 Q_DECLARE_PRIVATE(QAbstractBarSeries)
100 friend class AbstractBarChartItem;
100 friend class AbstractBarChartItem;
101 friend class PercentBarChartItem;
101 friend class PercentBarChartItem;
102 friend class StackedBarChartItem;
102 friend class StackedBarChartItem;
103 friend class BoxPlotChartItem;
103 friend class BoxPlotChartItem;
104 friend class BarChartItem;
104 friend class BarChartItem;
105 friend class HorizontalBarChartItem;
105 friend class HorizontalBarChartItem;
106 friend class HorizontalStackedBarChartItem;
106 friend class HorizontalStackedBarChartItem;
107 friend class HorizontalPercentBarChartItem;
107 friend class HorizontalPercentBarChartItem;
108 friend class BarSet;
108 friend class BarSet;
109 };
109 };
110
110
111 QT_CHARTS_END_NAMESPACE
111 QT_CHARTS_END_NAMESPACE
112
112
113 #endif // QABSTRACTBARSERIES_H
113 #endif // QABSTRACTBARSERIES_H
@@ -1,72 +1,72
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBARMODELMAPPER_H
22 #ifndef QBARMODELMAPPER_H
23 #define QBARMODELMAPPER_H
23 #define QBARMODELMAPPER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27
27
28 QT_BEGIN_NAMESPACE
28 QT_BEGIN_NAMESPACE
29 class QAbstractItemModel;
29 class QAbstractItemModel;
30 QT_END_NAMESPACE
30 QT_END_NAMESPACE
31
31
32 QT_CHARTS_BEGIN_NAMESPACE
32 QT_CHARTS_BEGIN_NAMESPACE
33
33
34 class QBarModelMapperPrivate;
34 class QBarModelMapperPrivate;
35 class QAbstractBarSeries;
35 class QAbstractBarSeries;
36
36
37 class QT_CHARTS_EXPORT QBarModelMapper : public QObject
37 class QT_CHARTS_EXPORT QBarModelMapper : public QObject
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40
40
41 protected:
41 protected:
42 explicit QBarModelMapper(QObject *parent = 0);
42 explicit QBarModelMapper(QObject *parent = Q_NULLPTR);
43
43
44 QAbstractItemModel *model() const;
44 QAbstractItemModel *model() const;
45 void setModel(QAbstractItemModel *model);
45 void setModel(QAbstractItemModel *model);
46
46
47 QAbstractBarSeries *series() const;
47 QAbstractBarSeries *series() const;
48 void setSeries(QAbstractBarSeries *series);
48 void setSeries(QAbstractBarSeries *series);
49
49
50 int first() const;
50 int first() const;
51 void setFirst(int first);
51 void setFirst(int first);
52
52
53 int count() const;
53 int count() const;
54 void setCount(int count);
54 void setCount(int count);
55
55
56 int firstBarSetSection() const;
56 int firstBarSetSection() const;
57 void setFirstBarSetSection(int firstBarSetSection);
57 void setFirstBarSetSection(int firstBarSetSection);
58
58
59 int lastBarSetSection() const;
59 int lastBarSetSection() const;
60 void setLastBarSetSection(int lastBarSetSection);
60 void setLastBarSetSection(int lastBarSetSection);
61
61
62 Qt::Orientation orientation() const;
62 Qt::Orientation orientation() const;
63 void setOrientation(Qt::Orientation orientation);
63 void setOrientation(Qt::Orientation orientation);
64
64
65 protected:
65 protected:
66 QBarModelMapperPrivate * const d_ptr;
66 QBarModelMapperPrivate * const d_ptr;
67 Q_DECLARE_PRIVATE(QBarModelMapper)
67 Q_DECLARE_PRIVATE(QBarModelMapper)
68 };
68 };
69
69
70 QT_CHARTS_END_NAMESPACE
70 QT_CHARTS_END_NAMESPACE
71
71
72 #endif // QBARMODELMAPPER_H
72 #endif // QBARMODELMAPPER_H
@@ -1,123 +1,123
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBARSET_H
22 #ifndef QBARSET_H
23 #define QBARSET_H
23 #define QBARSET_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtGui/QPen>
26 #include <QtGui/QPen>
27 #include <QtGui/QBrush>
27 #include <QtGui/QBrush>
28 #include <QtGui/QFont>
28 #include <QtGui/QFont>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31 class QBarSetPrivate;
31 class QBarSetPrivate;
32
32
33 class QT_CHARTS_EXPORT QBarSet : public QObject
33 class QT_CHARTS_EXPORT QBarSet : public QObject
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
36 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
37 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
37 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
38 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
38 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
39 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
39 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
40 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged)
40 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged)
41 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
41 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
42 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
42 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
43 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
43 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
44
44
45 public:
45 public:
46 explicit QBarSet(const QString label, QObject *parent = 0);
46 explicit QBarSet(const QString label, QObject *parent = Q_NULLPTR);
47 virtual ~QBarSet();
47 virtual ~QBarSet();
48
48
49 void setLabel(const QString label);
49 void setLabel(const QString label);
50 QString label() const;
50 QString label() const;
51
51
52 void append(const qreal value);
52 void append(const qreal value);
53 void append(const QList<qreal> &values);
53 void append(const QList<qreal> &values);
54
54
55 QBarSet &operator << (const qreal &value);
55 QBarSet &operator << (const qreal &value);
56
56
57 void insert(const int index, const qreal value);
57 void insert(const int index, const qreal value);
58 void remove(const int index, const int count = 1);
58 void remove(const int index, const int count = 1);
59 void replace(const int index, const qreal value);
59 void replace(const int index, const qreal value);
60 qreal at(const int index) const;
60 qreal at(const int index) const;
61 qreal operator [](const int index) const;
61 qreal operator [](const int index) const;
62 int count() const;
62 int count() const;
63 qreal sum() const;
63 qreal sum() const;
64
64
65 void setPen(const QPen &pen);
65 void setPen(const QPen &pen);
66 QPen pen() const;
66 QPen pen() const;
67
67
68 void setBrush(const QBrush &brush);
68 void setBrush(const QBrush &brush);
69 QBrush brush() const;
69 QBrush brush() const;
70
70
71 void setLabelBrush(const QBrush &brush);
71 void setLabelBrush(const QBrush &brush);
72 QBrush labelBrush() const;
72 QBrush labelBrush() const;
73
73
74 void setLabelFont(const QFont &font);
74 void setLabelFont(const QFont &font);
75 QFont labelFont() const;
75 QFont labelFont() const;
76
76
77 QColor color();
77 QColor color();
78 void setColor(QColor color);
78 void setColor(QColor color);
79
79
80 QColor borderColor();
80 QColor borderColor();
81 void setBorderColor(QColor color);
81 void setBorderColor(QColor color);
82
82
83 QColor labelColor();
83 QColor labelColor();
84 void setLabelColor(QColor color);
84 void setLabelColor(QColor color);
85
85
86 Q_SIGNALS:
86 Q_SIGNALS:
87 void clicked(int index);
87 void clicked(int index);
88 void hovered(bool status, int index);
88 void hovered(bool status, int index);
89 void pressed(int index);
89 void pressed(int index);
90 void released(int index);
90 void released(int index);
91 void doubleClicked(int index);
91 void doubleClicked(int index);
92 void penChanged();
92 void penChanged();
93 void brushChanged();
93 void brushChanged();
94 void labelChanged();
94 void labelChanged();
95 void labelBrushChanged();
95 void labelBrushChanged();
96 void labelFontChanged();
96 void labelFontChanged();
97 void colorChanged(QColor color);
97 void colorChanged(QColor color);
98 void borderColorChanged(QColor color);
98 void borderColorChanged(QColor color);
99 void labelColorChanged(QColor color);
99 void labelColorChanged(QColor color);
100
100
101 void valuesAdded(int index, int count);
101 void valuesAdded(int index, int count);
102 void valuesRemoved(int index, int count);
102 void valuesRemoved(int index, int count);
103 void valueChanged(int index);
103 void valueChanged(int index);
104
104
105 private:
105 private:
106 QScopedPointer<QBarSetPrivate> d_ptr;
106 QScopedPointer<QBarSetPrivate> d_ptr;
107 Q_DISABLE_COPY(QBarSet)
107 Q_DISABLE_COPY(QBarSet)
108 friend class QAbstractBarSeries;
108 friend class QAbstractBarSeries;
109 friend class BarLegendMarker;
109 friend class BarLegendMarker;
110 friend class AbstractBarChartItem;
110 friend class AbstractBarChartItem;
111 friend class QAbstractBarSeriesPrivate;
111 friend class QAbstractBarSeriesPrivate;
112 friend class StackedBarChartItem;
112 friend class StackedBarChartItem;
113 friend class PercentBarChartItem;
113 friend class PercentBarChartItem;
114 friend class BarChartItem;
114 friend class BarChartItem;
115 friend class HorizontalBarChartItem;
115 friend class HorizontalBarChartItem;
116 friend class HorizontalStackedBarChartItem;
116 friend class HorizontalStackedBarChartItem;
117 friend class HorizontalPercentBarChartItem;
117 friend class HorizontalPercentBarChartItem;
118 friend class BoxPlotChartItem;
118 friend class BoxPlotChartItem;
119 };
119 };
120
120
121 QT_CHARTS_END_NAMESPACE
121 QT_CHARTS_END_NAMESPACE
122
122
123 #endif // QBARSET_H
123 #endif // QBARSET_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHBARMODELMAPPER_H
22 #ifndef QHBARMODELMAPPER_H
23 #define QHBARMODELMAPPER_H
23 #define QHBARMODELMAPPER_H
24
24
25 #include <QtCharts/QBarModelMapper>
25 #include <QtCharts/QBarModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QHBarModelMapper : public QBarModelMapper
29 class QT_CHARTS_EXPORT QHBarModelMapper : public QBarModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QAbstractBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QAbstractBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int firstBarSetRow READ firstBarSetRow WRITE setFirstBarSetRow NOTIFY firstBarSetRowChanged)
34 Q_PROPERTY(int firstBarSetRow READ firstBarSetRow WRITE setFirstBarSetRow NOTIFY firstBarSetRowChanged)
35 Q_PROPERTY(int lastBarSetRow READ lastBarSetRow WRITE setLastBarSetRow NOTIFY lastBarSetRowChanged)
35 Q_PROPERTY(int lastBarSetRow READ lastBarSetRow WRITE setLastBarSetRow NOTIFY lastBarSetRowChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
38
38
39 public:
39 public:
40 explicit QHBarModelMapper(QObject *parent = 0);
40 explicit QHBarModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QAbstractBarSeries *series() const;
45 QAbstractBarSeries *series() const;
46 void setSeries(QAbstractBarSeries *series);
46 void setSeries(QAbstractBarSeries *series);
47
47
48 int firstBarSetRow() const;
48 int firstBarSetRow() const;
49 void setFirstBarSetRow(int firstBarSetRow);
49 void setFirstBarSetRow(int firstBarSetRow);
50
50
51 int lastBarSetRow() const;
51 int lastBarSetRow() const;
52 void setLastBarSetRow(int lastBarSetRow);
52 void setLastBarSetRow(int lastBarSetRow);
53
53
54 int firstColumn() const;
54 int firstColumn() const;
55 void setFirstColumn(int firstColumn);
55 void setFirstColumn(int firstColumn);
56
56
57 int columnCount() const;
57 int columnCount() const;
58 void setColumnCount(int columnCount);
58 void setColumnCount(int columnCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void firstBarSetRowChanged();
63 void firstBarSetRowChanged();
64 void lastBarSetRowChanged();
64 void lastBarSetRowChanged();
65 void firstColumnChanged();
65 void firstColumnChanged();
66 void columnCountChanged();
66 void columnCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QHBARMODELMAPPER_H
71 #endif // QHBARMODELMAPPER_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QVBARMODELMAPPER_H
22 #ifndef QVBARMODELMAPPER_H
23 #define QVBARMODELMAPPER_H
23 #define QVBARMODELMAPPER_H
24
24
25 #include <QtCharts/QBarModelMapper>
25 #include <QtCharts/QBarModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QVBarModelMapper : public QBarModelMapper
29 class QT_CHARTS_EXPORT QVBarModelMapper : public QBarModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QAbstractBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QAbstractBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int firstBarSetColumn READ firstBarSetColumn WRITE setFirstBarSetColumn NOTIFY firstBarSetColumnChanged)
34 Q_PROPERTY(int firstBarSetColumn READ firstBarSetColumn WRITE setFirstBarSetColumn NOTIFY firstBarSetColumnChanged)
35 Q_PROPERTY(int lastBarSetColumn READ lastBarSetColumn WRITE setLastBarSetColumn NOTIFY lastBarSetColumnChanged)
35 Q_PROPERTY(int lastBarSetColumn READ lastBarSetColumn WRITE setLastBarSetColumn NOTIFY lastBarSetColumnChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
38
38
39 public:
39 public:
40 explicit QVBarModelMapper(QObject *parent = 0);
40 explicit QVBarModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QAbstractBarSeries *series() const;
45 QAbstractBarSeries *series() const;
46 void setSeries(QAbstractBarSeries *series);
46 void setSeries(QAbstractBarSeries *series);
47
47
48 int firstBarSetColumn() const;
48 int firstBarSetColumn() const;
49 void setFirstBarSetColumn(int firstBarSetColumn);
49 void setFirstBarSetColumn(int firstBarSetColumn);
50
50
51 int lastBarSetColumn() const;
51 int lastBarSetColumn() const;
52 void setLastBarSetColumn(int lastBarSetColumn);
52 void setLastBarSetColumn(int lastBarSetColumn);
53
53
54 int firstRow() const;
54 int firstRow() const;
55 void setFirstRow(int firstRow);
55 void setFirstRow(int firstRow);
56
56
57 int rowCount() const;
57 int rowCount() const;
58 void setRowCount(int rowCount);
58 void setRowCount(int rowCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void firstBarSetColumnChanged();
63 void firstBarSetColumnChanged();
64 void lastBarSetColumnChanged();
64 void lastBarSetColumnChanged();
65 void firstRowChanged();
65 void firstRowChanged();
66 void rowCountChanged();
66 void rowCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QVBARMODELMAPPER_H
71 #endif // QVBARMODELMAPPER_H
@@ -1,46 +1,46
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBARSERIES_H
22 #ifndef QBARSERIES_H
23 #define QBARSERIES_H
23 #define QBARSERIES_H
24
24
25 #include <QtCharts/QAbstractBarSeries>
25 #include <QtCharts/QAbstractBarSeries>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QBarSeriesPrivate;
29 class QBarSeriesPrivate;
30
30
31 class QT_CHARTS_EXPORT QBarSeries : public QAbstractBarSeries
31 class QT_CHARTS_EXPORT QBarSeries : public QAbstractBarSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 public:
34 public:
35 explicit QBarSeries(QObject *parent = 0);
35 explicit QBarSeries(QObject *parent = Q_NULLPTR);
36 ~QBarSeries();
36 ~QBarSeries();
37 QAbstractSeries::SeriesType type() const;
37 QAbstractSeries::SeriesType type() const;
38
38
39 private:
39 private:
40 Q_DECLARE_PRIVATE(QBarSeries)
40 Q_DECLARE_PRIVATE(QBarSeries)
41 Q_DISABLE_COPY(QBarSeries)
41 Q_DISABLE_COPY(QBarSeries)
42 };
42 };
43
43
44 QT_CHARTS_END_NAMESPACE
44 QT_CHARTS_END_NAMESPACE
45
45
46 #endif // QBARSERIES_H
46 #endif // QBARSERIES_H
@@ -1,47 +1,47
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPERCENTBARSERIES_H
22 #ifndef QPERCENTBARSERIES_H
23 #define QPERCENTBARSERIES_H
23 #define QPERCENTBARSERIES_H
24
24
25 #include <QtCore/QStringList>
25 #include <QtCore/QStringList>
26 #include <QtCharts/QAbstractBarSeries>
26 #include <QtCharts/QAbstractBarSeries>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29
29
30 class QPercentBarSeriesPrivate;
30 class QPercentBarSeriesPrivate;
31
31
32 class QT_CHARTS_EXPORT QPercentBarSeries : public QAbstractBarSeries
32 class QT_CHARTS_EXPORT QPercentBarSeries : public QAbstractBarSeries
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 public:
35 public:
36 explicit QPercentBarSeries(QObject *parent = 0);
36 explicit QPercentBarSeries(QObject *parent = Q_NULLPTR);
37 ~QPercentBarSeries();
37 ~QPercentBarSeries();
38 QAbstractSeries::SeriesType type() const;
38 QAbstractSeries::SeriesType type() const;
39
39
40 private:
40 private:
41 Q_DECLARE_PRIVATE(QPercentBarSeries)
41 Q_DECLARE_PRIVATE(QPercentBarSeries)
42 Q_DISABLE_COPY(QPercentBarSeries)
42 Q_DISABLE_COPY(QPercentBarSeries)
43 };
43 };
44
44
45 QT_CHARTS_END_NAMESPACE
45 QT_CHARTS_END_NAMESPACE
46
46
47 #endif // QPERCENTBARSERIES_H
47 #endif // QPERCENTBARSERIES_H
@@ -1,47 +1,47
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QSTACKEDBARSERIES_H
22 #ifndef QSTACKEDBARSERIES_H
23 #define QSTACKEDBARSERIES_H
23 #define QSTACKEDBARSERIES_H
24
24
25 #include <QtCore/QStringList>
25 #include <QtCore/QStringList>
26 #include <QtCharts/QAbstractBarSeries>
26 #include <QtCharts/QAbstractBarSeries>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29
29
30 class QStackedBarSeriesPrivate;
30 class QStackedBarSeriesPrivate;
31
31
32 class QT_CHARTS_EXPORT QStackedBarSeries : public QAbstractBarSeries
32 class QT_CHARTS_EXPORT QStackedBarSeries : public QAbstractBarSeries
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 public:
35 public:
36 explicit QStackedBarSeries(QObject *parent = 0);
36 explicit QStackedBarSeries(QObject *parent = Q_NULLPTR);
37 ~QStackedBarSeries();
37 ~QStackedBarSeries();
38 QAbstractSeries::SeriesType type() const;
38 QAbstractSeries::SeriesType type() const;
39
39
40 private:
40 private:
41 Q_DECLARE_PRIVATE(QStackedBarSeries)
41 Q_DECLARE_PRIVATE(QStackedBarSeries)
42 Q_DISABLE_COPY(QStackedBarSeries)
42 Q_DISABLE_COPY(QStackedBarSeries)
43 };
43 };
44
44
45 QT_CHARTS_END_NAMESPACE
45 QT_CHARTS_END_NAMESPACE
46
46
47 #endif // QSTACKEDBARSERIES_H
47 #endif // QSTACKEDBARSERIES_H
@@ -1,72 +1,72
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBOXPLOTMODELMAPPER_H
22 #ifndef QBOXPLOTMODELMAPPER_H
23 #define QBOXPLOTMODELMAPPER_H
23 #define QBOXPLOTMODELMAPPER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27
27
28 QT_BEGIN_NAMESPACE
28 QT_BEGIN_NAMESPACE
29 class QAbstractItemModel;
29 class QAbstractItemModel;
30 QT_END_NAMESPACE
30 QT_END_NAMESPACE
31
31
32 QT_CHARTS_BEGIN_NAMESPACE
32 QT_CHARTS_BEGIN_NAMESPACE
33
33
34 class QBoxPlotModelMapperPrivate;
34 class QBoxPlotModelMapperPrivate;
35 class QBoxPlotSeries;
35 class QBoxPlotSeries;
36
36
37 class QT_CHARTS_EXPORT QBoxPlotModelMapper : public QObject
37 class QT_CHARTS_EXPORT QBoxPlotModelMapper : public QObject
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40
40
41 protected:
41 protected:
42 explicit QBoxPlotModelMapper(QObject *parent = 0);
42 explicit QBoxPlotModelMapper(QObject *parent = Q_NULLPTR);
43
43
44 QAbstractItemModel *model() const;
44 QAbstractItemModel *model() const;
45 void setModel(QAbstractItemModel *model);
45 void setModel(QAbstractItemModel *model);
46
46
47 QBoxPlotSeries *series() const;
47 QBoxPlotSeries *series() const;
48 void setSeries(QBoxPlotSeries *series);
48 void setSeries(QBoxPlotSeries *series);
49
49
50 int first() const;
50 int first() const;
51 void setFirst(int first);
51 void setFirst(int first);
52
52
53 int count() const;
53 int count() const;
54 void setCount(int count);
54 void setCount(int count);
55
55
56 int firstBoxSetSection() const;
56 int firstBoxSetSection() const;
57 void setFirstBoxSetSection(int firstBoxSetSection);
57 void setFirstBoxSetSection(int firstBoxSetSection);
58
58
59 int lastBoxSetSection() const;
59 int lastBoxSetSection() const;
60 void setLastBoxSetSection(int lastBoxSetSection);
60 void setLastBoxSetSection(int lastBoxSetSection);
61
61
62 Qt::Orientation orientation() const;
62 Qt::Orientation orientation() const;
63 void setOrientation(Qt::Orientation orientation);
63 void setOrientation(Qt::Orientation orientation);
64
64
65 protected:
65 protected:
66 QBoxPlotModelMapperPrivate * const d_ptr;
66 QBoxPlotModelMapperPrivate * const d_ptr;
67 Q_DECLARE_PRIVATE(QBoxPlotModelMapper)
67 Q_DECLARE_PRIVATE(QBoxPlotModelMapper)
68 };
68 };
69
69
70 QT_CHARTS_END_NAMESPACE
70 QT_CHARTS_END_NAMESPACE
71
71
72 #endif // QBOXPLOTMODELMAPPER_H
72 #endif // QBOXPLOTMODELMAPPER_H
@@ -1,89 +1,89
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBOXPLOTSERIES_H
22 #ifndef QBOXPLOTSERIES_H
23 #define QBOXPLOTSERIES_H
23 #define QBOXPLOTSERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QBoxSet>
26 #include <QtCharts/QBoxSet>
27 #include <QtCharts/QAbstractSeries>
27 #include <QtCharts/QAbstractSeries>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QBoxPlotSeriesPrivate;
31 class QBoxPlotSeriesPrivate;
32
32
33 class QT_CHARTS_EXPORT QBoxPlotSeries : public QAbstractSeries
33 class QT_CHARTS_EXPORT QBoxPlotSeries : public QAbstractSeries
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_PROPERTY(bool boxOutlineVisible READ boxOutlineVisible WRITE setBoxOutlineVisible NOTIFY boxOutlineVisibilityChanged)
36 Q_PROPERTY(bool boxOutlineVisible READ boxOutlineVisible WRITE setBoxOutlineVisible NOTIFY boxOutlineVisibilityChanged)
37 Q_PROPERTY(qreal boxWidth READ boxWidth WRITE setBoxWidth NOTIFY boxWidthChanged)
37 Q_PROPERTY(qreal boxWidth READ boxWidth WRITE setBoxWidth NOTIFY boxWidthChanged)
38 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
38 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
39 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
39 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
40 Q_PROPERTY(int count READ count NOTIFY countChanged REVISION 1)
40 Q_PROPERTY(int count READ count NOTIFY countChanged REVISION 1)
41 public:
41 public:
42 explicit QBoxPlotSeries(QObject *parent = 0);
42 explicit QBoxPlotSeries(QObject *parent = Q_NULLPTR);
43 ~QBoxPlotSeries();
43 ~QBoxPlotSeries();
44
44
45 bool append(QBoxSet *box);
45 bool append(QBoxSet *box);
46 bool remove(QBoxSet *box);
46 bool remove(QBoxSet *box);
47 bool take(QBoxSet *box);
47 bool take(QBoxSet *box);
48 bool append(QList<QBoxSet *> boxes);
48 bool append(QList<QBoxSet *> boxes);
49 bool insert(int index, QBoxSet *box);
49 bool insert(int index, QBoxSet *box);
50 int count() const;
50 int count() const;
51 QList<QBoxSet *> boxSets() const;
51 QList<QBoxSet *> boxSets() const;
52 void clear();
52 void clear();
53
53
54 QAbstractSeries::SeriesType type() const;
54 QAbstractSeries::SeriesType type() const;
55
55
56 void setBoxOutlineVisible(bool visible);
56 void setBoxOutlineVisible(bool visible);
57 bool boxOutlineVisible();
57 bool boxOutlineVisible();
58 void setBoxWidth(qreal width);
58 void setBoxWidth(qreal width);
59 qreal boxWidth();
59 qreal boxWidth();
60 void setBrush(const QBrush &brush);
60 void setBrush(const QBrush &brush);
61 QBrush brush() const;
61 QBrush brush() const;
62 void setPen(const QPen &pen);
62 void setPen(const QPen &pen);
63 QPen pen() const;
63 QPen pen() const;
64
64
65 Q_SIGNALS:
65 Q_SIGNALS:
66 void clicked(QBoxSet *boxset);
66 void clicked(QBoxSet *boxset);
67 void hovered(bool status, QBoxSet *boxset);
67 void hovered(bool status, QBoxSet *boxset);
68 void pressed(QBoxSet *boxset);
68 void pressed(QBoxSet *boxset);
69 void released(QBoxSet *boxset);
69 void released(QBoxSet *boxset);
70 void doubleClicked(QBoxSet *boxset);
70 void doubleClicked(QBoxSet *boxset);
71 void countChanged();
71 void countChanged();
72 void penChanged();
72 void penChanged();
73 void brushChanged();
73 void brushChanged();
74 void boxOutlineVisibilityChanged();
74 void boxOutlineVisibilityChanged();
75 void boxWidthChanged();
75 void boxWidthChanged();
76
76
77 void boxsetsAdded(QList<QBoxSet *> sets);
77 void boxsetsAdded(QList<QBoxSet *> sets);
78 void boxsetsRemoved(QList<QBoxSet *> sets);
78 void boxsetsRemoved(QList<QBoxSet *> sets);
79
79
80 private:
80 private:
81 Q_DECLARE_PRIVATE(QBoxPlotSeries)
81 Q_DECLARE_PRIVATE(QBoxPlotSeries)
82 Q_DISABLE_COPY(QBoxPlotSeries)
82 Q_DISABLE_COPY(QBoxPlotSeries)
83 friend class BoxPlotChartItem;
83 friend class BoxPlotChartItem;
84 friend class QBoxPlotLegendMarkerPrivate;
84 friend class QBoxPlotLegendMarkerPrivate;
85 };
85 };
86
86
87 QT_CHARTS_END_NAMESPACE
87 QT_CHARTS_END_NAMESPACE
88
88
89 #endif // QBOXPLOTSERIES_H
89 #endif // QBOXPLOTSERIES_H
@@ -1,98 +1,98
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBOXSET_H
22 #ifndef QBOXSET_H
23 #define QBOXSET_H
23 #define QBOXSET_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtGui/QPen>
26 #include <QtGui/QPen>
27 #include <QtGui/QBrush>
27 #include <QtGui/QBrush>
28 #include <QtGui/QFont>
28 #include <QtGui/QFont>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31 class QBoxSetPrivate;
31 class QBoxSetPrivate;
32
32
33 class QT_CHARTS_EXPORT QBoxSet : public QObject
33 class QT_CHARTS_EXPORT QBoxSet : public QObject
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
36 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
37 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
37 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
38
38
39 public:
39 public:
40 enum ValuePositions {
40 enum ValuePositions {
41 LowerExtreme,
41 LowerExtreme,
42 LowerQuartile,
42 LowerQuartile,
43 Median,
43 Median,
44 UpperQuartile,
44 UpperQuartile,
45 UpperExtreme
45 UpperExtreme
46 };
46 };
47
47
48 public:
48 public:
49 explicit QBoxSet(const QString label = QString(), QObject *parent = 0);
49 explicit QBoxSet(const QString label = QString(), QObject *parent = Q_NULLPTR);
50 explicit QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label = QString(), QObject *parent = 0);
50 explicit QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label = QString(), QObject *parent = Q_NULLPTR);
51 virtual ~QBoxSet();
51 virtual ~QBoxSet();
52
52
53 void append(const qreal value);
53 void append(const qreal value);
54 void append(const QList<qreal> &values);
54 void append(const QList<qreal> &values);
55
55
56 void clear();
56 void clear();
57
57
58 void setLabel(const QString label);
58 void setLabel(const QString label);
59 QString label() const;
59 QString label() const;
60
60
61 QBoxSet &operator << (const qreal &value);
61 QBoxSet &operator << (const qreal &value);
62
62
63 void setValue(const int index, const qreal value);
63 void setValue(const int index, const qreal value);
64 qreal at(const int index) const;
64 qreal at(const int index) const;
65 qreal operator [](const int index) const;
65 qreal operator [](const int index) const;
66 int count() const;
66 int count() const;
67
67
68 void setPen(const QPen &pen);
68 void setPen(const QPen &pen);
69 QPen pen() const;
69 QPen pen() const;
70
70
71 void setBrush(const QBrush &brush);
71 void setBrush(const QBrush &brush);
72 QBrush brush() const;
72 QBrush brush() const;
73
73
74 Q_SIGNALS:
74 Q_SIGNALS:
75 void clicked();
75 void clicked();
76 void hovered(bool status);
76 void hovered(bool status);
77 void pressed();
77 void pressed();
78 void released();
78 void released();
79 void doubleClicked();
79 void doubleClicked();
80 void penChanged();
80 void penChanged();
81 void brushChanged();
81 void brushChanged();
82
82
83 void valuesChanged();
83 void valuesChanged();
84 void valueChanged(int index);
84 void valueChanged(int index);
85 void cleared();
85 void cleared();
86
86
87 private:
87 private:
88 QScopedPointer<QBoxSetPrivate> d_ptr;
88 QScopedPointer<QBoxSetPrivate> d_ptr;
89 Q_DISABLE_COPY(QBoxSet)
89 Q_DISABLE_COPY(QBoxSet)
90 friend class BarLegendMarker;
90 friend class BarLegendMarker;
91 friend class BarChartItem;
91 friend class BarChartItem;
92 friend class BoxPlotChartItem;
92 friend class BoxPlotChartItem;
93 friend class QBoxPlotSeriesPrivate;
93 friend class QBoxPlotSeriesPrivate;
94 };
94 };
95
95
96 QT_CHARTS_END_NAMESPACE
96 QT_CHARTS_END_NAMESPACE
97
97
98 #endif // QBOXSET_H
98 #endif // QBOXSET_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QVBOXPLOTMODELMAPPER_H
22 #ifndef QVBOXPLOTMODELMAPPER_H
23 #define QVBOXPLOTMODELMAPPER_H
23 #define QVBOXPLOTMODELMAPPER_H
24
24
25 #include <QtCharts/QBoxPlotModelMapper>
25 #include <QtCharts/QBoxPlotModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QVBoxPlotModelMapper : public QBoxPlotModelMapper
29 class QT_CHARTS_EXPORT QVBoxPlotModelMapper : public QBoxPlotModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QBoxPlotSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QBoxPlotSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int firstBoxSetColumn READ firstBoxSetColumn WRITE setFirstBoxSetColumn NOTIFY firstBoxSetColumnChanged)
34 Q_PROPERTY(int firstBoxSetColumn READ firstBoxSetColumn WRITE setFirstBoxSetColumn NOTIFY firstBoxSetColumnChanged)
35 Q_PROPERTY(int lastBoxSetColumn READ lastBoxSetColumn WRITE setLastBoxSetColumn NOTIFY lastBoxSetColumnChanged)
35 Q_PROPERTY(int lastBoxSetColumn READ lastBoxSetColumn WRITE setLastBoxSetColumn NOTIFY lastBoxSetColumnChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
38
38
39 public:
39 public:
40 explicit QVBoxPlotModelMapper(QObject *parent = 0);
40 explicit QVBoxPlotModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QBoxPlotSeries *series() const;
45 QBoxPlotSeries *series() const;
46 void setSeries(QBoxPlotSeries *series);
46 void setSeries(QBoxPlotSeries *series);
47
47
48 int firstBoxSetColumn() const;
48 int firstBoxSetColumn() const;
49 void setFirstBoxSetColumn(int firstBoxSetColumn);
49 void setFirstBoxSetColumn(int firstBoxSetColumn);
50
50
51 int lastBoxSetColumn() const;
51 int lastBoxSetColumn() const;
52 void setLastBoxSetColumn(int lastBoxSetColumn);
52 void setLastBoxSetColumn(int lastBoxSetColumn);
53
53
54 int firstRow() const;
54 int firstRow() const;
55 void setFirstRow(int firstRow);
55 void setFirstRow(int firstRow);
56
56
57 int rowCount() const;
57 int rowCount() const;
58 void setRowCount(int rowCount);
58 void setRowCount(int rowCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void firstBoxSetColumnChanged();
63 void firstBoxSetColumnChanged();
64 void lastBoxSetColumnChanged();
64 void lastBoxSetColumnChanged();
65 void firstRowChanged();
65 void firstRowChanged();
66 void rowCountChanged();
66 void rowCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QVBOXPLOTMODELMAPPER_H
71 #endif // QVBOXPLOTMODELMAPPER_H
@@ -1,57 +1,57
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QAREALEGENDMARKER_H
22 #ifndef QAREALEGENDMARKER_H
23 #define QAREALEGENDMARKER_H
23 #define QAREALEGENDMARKER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QLegendMarker>
26 #include <QtCharts/QLegendMarker>
27 #include <QtCharts/QAreaSeries>
27 #include <QtCharts/QAreaSeries>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QAreaLegendMarkerPrivate;
31 class QAreaLegendMarkerPrivate;
32
32
33 class QT_CHARTS_EXPORT QAreaLegendMarker : public QLegendMarker
33 class QT_CHARTS_EXPORT QAreaLegendMarker : public QLegendMarker
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36
36
37 public:
37 public:
38 explicit QAreaLegendMarker(QAreaSeries *series, QLegend *legend, QObject *parent = 0);
38 explicit QAreaLegendMarker(QAreaSeries *series, QLegend *legend, QObject *parent = Q_NULLPTR);
39 virtual ~QAreaLegendMarker();
39 virtual ~QAreaLegendMarker();
40
40
41 virtual LegendMarkerType type() { return LegendMarkerTypeArea; }
41 virtual LegendMarkerType type() { return LegendMarkerTypeArea; }
42
42
43 // Related series
43 // Related series
44 virtual QAreaSeries* series();
44 virtual QAreaSeries* series();
45
45
46 protected:
46 protected:
47 QAreaLegendMarker(QAreaLegendMarkerPrivate &d, QObject *parent = 0);
47 QAreaLegendMarker(QAreaLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
48
48
49 private:
49 private:
50 Q_DECLARE_PRIVATE(QAreaLegendMarker)
50 Q_DECLARE_PRIVATE(QAreaLegendMarker)
51 Q_DISABLE_COPY(QAreaLegendMarker)
51 Q_DISABLE_COPY(QAreaLegendMarker)
52
52
53 };
53 };
54
54
55 QT_CHARTS_END_NAMESPACE
55 QT_CHARTS_END_NAMESPACE
56
56
57 #endif // QAREALEGENDMARKER_H
57 #endif // QAREALEGENDMARKER_H
@@ -1,58 +1,58
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21 #ifndef QBARLEGENDMARKER_H
21 #ifndef QBARLEGENDMARKER_H
22 #define QBARLEGENDMARKER_H
22 #define QBARLEGENDMARKER_H
23
23
24 #include <QtCharts/QChartGlobal>
24 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QLegendMarker>
25 #include <QtCharts/QLegendMarker>
26 #include <QtCharts/QAbstractBarSeries>
26 #include <QtCharts/QAbstractBarSeries>
27 #include <QtCharts/QBarSet>
27 #include <QtCharts/QBarSet>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QLegend;
31 class QLegend;
32 class QBarLegendMarkerPrivate;
32 class QBarLegendMarkerPrivate;
33
33
34 class QT_CHARTS_EXPORT QBarLegendMarker : public QLegendMarker
34 class QT_CHARTS_EXPORT QBarLegendMarker : public QLegendMarker
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37 public:
37 public:
38 explicit QBarLegendMarker(QAbstractBarSeries *series, QBarSet *barset, QLegend *legend, QObject *parent = 0);
38 explicit QBarLegendMarker(QAbstractBarSeries *series, QBarSet *barset, QLegend *legend, QObject *parent = Q_NULLPTR);
39 virtual ~QBarLegendMarker();
39 virtual ~QBarLegendMarker();
40
40
41 virtual LegendMarkerType type() { return LegendMarkerTypeBar; }
41 virtual LegendMarkerType type() { return LegendMarkerTypeBar; }
42
42
43 // Related series and barset
43 // Related series and barset
44 virtual QAbstractBarSeries* series();
44 virtual QAbstractBarSeries* series();
45 QBarSet* barset();
45 QBarSet* barset();
46
46
47 protected:
47 protected:
48 QBarLegendMarker(QBarLegendMarkerPrivate &d, QObject *parent = 0);
48 QBarLegendMarker(QBarLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
49
49
50 private:
50 private:
51 Q_DECLARE_PRIVATE(QBarLegendMarker)
51 Q_DECLARE_PRIVATE(QBarLegendMarker)
52 Q_DISABLE_COPY(QBarLegendMarker)
52 Q_DISABLE_COPY(QBarLegendMarker)
53
53
54 };
54 };
55
55
56 QT_CHARTS_END_NAMESPACE
56 QT_CHARTS_END_NAMESPACE
57
57
58 #endif // QBARLEGENDMARKER_H
58 #endif // QBARLEGENDMARKER_H
@@ -1,56 +1,56
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QBOXPLOTLEGENDMARKER_H
22 #ifndef QBOXPLOTLEGENDMARKER_H
23 #define QBOXPLOTLEGENDMARKER_H
23 #define QBOXPLOTLEGENDMARKER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QLegendMarker>
26 #include <QtCharts/QLegendMarker>
27 #include <QtCharts/QBoxPlotSeries>
27 #include <QtCharts/QBoxPlotSeries>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QBoxPlotLegendMarkerPrivate;
31 class QBoxPlotLegendMarkerPrivate;
32
32
33 class QT_CHARTS_EXPORT QBoxPlotLegendMarker : public QLegendMarker
33 class QT_CHARTS_EXPORT QBoxPlotLegendMarker : public QLegendMarker
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36
36
37 public:
37 public:
38 explicit QBoxPlotLegendMarker(QBoxPlotSeries *series, QLegend *legend, QObject *parent = 0);
38 explicit QBoxPlotLegendMarker(QBoxPlotSeries *series, QLegend *legend, QObject *parent = Q_NULLPTR);
39 virtual ~QBoxPlotLegendMarker();
39 virtual ~QBoxPlotLegendMarker();
40
40
41 virtual LegendMarkerType type() { return LegendMarkerTypeBoxPlot; }
41 virtual LegendMarkerType type() { return LegendMarkerTypeBoxPlot; }
42
42
43 // Related series
43 // Related series
44 virtual QBoxPlotSeries* series();
44 virtual QBoxPlotSeries* series();
45
45
46 protected:
46 protected:
47 QBoxPlotLegendMarker(QBoxPlotLegendMarkerPrivate &d, QObject *parent = 0);
47 QBoxPlotLegendMarker(QBoxPlotLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
48
48
49 private:
49 private:
50 Q_DECLARE_PRIVATE(QBoxPlotLegendMarker)
50 Q_DECLARE_PRIVATE(QBoxPlotLegendMarker)
51 Q_DISABLE_COPY(QBoxPlotLegendMarker)
51 Q_DISABLE_COPY(QBoxPlotLegendMarker)
52 };
52 };
53
53
54 QT_CHARTS_END_NAMESPACE
54 QT_CHARTS_END_NAMESPACE
55
55
56 #endif // QBOXPLOTLEGENDMARKER_H
56 #endif // QBOXPLOTLEGENDMARKER_H
@@ -1,113 +1,113
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QLEGEND_H
22 #ifndef QLEGEND_H
23 #define QLEGEND_H
23 #define QLEGEND_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtWidgets/QGraphicsWidget>
26 #include <QtWidgets/QGraphicsWidget>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28 #include <QtGui/QBrush>
28 #include <QtGui/QBrush>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31
31
32 class QChart;
32 class QChart;
33 class QLegendPrivate;
33 class QLegendPrivate;
34 class QLegendMarker;
34 class QLegendMarker;
35 class QAbstractSeries;
35 class QAbstractSeries;
36
36
37 class QT_CHARTS_EXPORT QLegend : public QGraphicsWidget
37 class QT_CHARTS_EXPORT QLegend : public QGraphicsWidget
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
40 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
41 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
41 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
42 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
42 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
43 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
43 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
44 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
44 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
45 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
45 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
46 Q_PROPERTY(bool reverseMarkers READ reverseMarkers WRITE setReverseMarkers NOTIFY reverseMarkersChanged)
46 Q_PROPERTY(bool reverseMarkers READ reverseMarkers WRITE setReverseMarkers NOTIFY reverseMarkersChanged)
47
47
48 private:
48 private:
49 explicit QLegend(QChart *chart);
49 explicit QLegend(QChart *chart);
50
50
51 public:
51 public:
52 ~QLegend();
52 ~QLegend();
53
53
54 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
54 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR);
55
55
56 void setBrush(const QBrush &brush);
56 void setBrush(const QBrush &brush);
57 QBrush brush() const;
57 QBrush brush() const;
58 void setColor(QColor color);
58 void setColor(QColor color);
59 QColor color();
59 QColor color();
60
60
61 void setPen(const QPen &pen);
61 void setPen(const QPen &pen);
62 QPen pen() const;
62 QPen pen() const;
63 void setBorderColor(QColor color);
63 void setBorderColor(QColor color);
64 QColor borderColor();
64 QColor borderColor();
65
65
66 void setFont(const QFont &font);
66 void setFont(const QFont &font);
67 QFont font() const;
67 QFont font() const;
68 void setLabelBrush(const QBrush &brush);
68 void setLabelBrush(const QBrush &brush);
69 QBrush labelBrush() const;
69 QBrush labelBrush() const;
70
70
71 void setLabelColor(QColor color);
71 void setLabelColor(QColor color);
72 QColor labelColor() const;
72 QColor labelColor() const;
73
73
74 void setAlignment(Qt::Alignment alignment);
74 void setAlignment(Qt::Alignment alignment);
75 Qt::Alignment alignment() const;
75 Qt::Alignment alignment() const;
76
76
77 void detachFromChart();
77 void detachFromChart();
78 void attachToChart();
78 void attachToChart();
79 bool isAttachedToChart();
79 bool isAttachedToChart();
80
80
81 void setBackgroundVisible(bool visible = true);
81 void setBackgroundVisible(bool visible = true);
82 bool isBackgroundVisible() const;
82 bool isBackgroundVisible() const;
83
83
84 QList <QLegendMarker*> markers(QAbstractSeries *series = 0) const;
84 QList <QLegendMarker*> markers(QAbstractSeries *series = Q_NULLPTR) const;
85
85
86 bool reverseMarkers();
86 bool reverseMarkers();
87 void setReverseMarkers(bool reverseMarkers = true);
87 void setReverseMarkers(bool reverseMarkers = true);
88
88
89 protected:
89 protected:
90 void hideEvent(QHideEvent *event);
90 void hideEvent(QHideEvent *event);
91 void showEvent(QShowEvent *event);
91 void showEvent(QShowEvent *event);
92
92
93 Q_SIGNALS:
93 Q_SIGNALS:
94 void backgroundVisibleChanged(bool visible);
94 void backgroundVisibleChanged(bool visible);
95 void colorChanged(QColor color);
95 void colorChanged(QColor color);
96 void borderColorChanged(QColor color);
96 void borderColorChanged(QColor color);
97 void fontChanged(QFont font);
97 void fontChanged(QFont font);
98 void labelColorChanged(QColor color);
98 void labelColorChanged(QColor color);
99 void reverseMarkersChanged(bool reverseMarkers);
99 void reverseMarkersChanged(bool reverseMarkers);
100
100
101 private:
101 private:
102 QScopedPointer<QLegendPrivate> d_ptr;
102 QScopedPointer<QLegendPrivate> d_ptr;
103 Q_DISABLE_COPY(QLegend)
103 Q_DISABLE_COPY(QLegend)
104 friend class LegendScroller;
104 friend class LegendScroller;
105 friend class LegendLayout;
105 friend class LegendLayout;
106 friend class ChartLayout;
106 friend class ChartLayout;
107 friend class LegendMarkerItem;
107 friend class LegendMarkerItem;
108 friend class QLegendMarkerPrivate;
108 friend class QLegendMarkerPrivate;
109 };
109 };
110
110
111 QT_CHARTS_END_NAMESPACE
111 QT_CHARTS_END_NAMESPACE
112
112
113 #endif // QLEGEND_H
113 #endif // QLEGEND_H
@@ -1,108 +1,108
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QLEGENDMARKER_H
22 #ifndef QLEGENDMARKER_H
23 #define QLEGENDMARKER_H
23 #define QLEGENDMARKER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28 #include <QtGui/QBrush>
28 #include <QtGui/QBrush>
29 #include <QtGui/QFont>
29 #include <QtGui/QFont>
30
30
31 QT_CHARTS_BEGIN_NAMESPACE
31 QT_CHARTS_BEGIN_NAMESPACE
32
32
33 class QLegendMarkerPrivate;
33 class QLegendMarkerPrivate;
34 class QAbstractSeries;
34 class QAbstractSeries;
35 class QLegend;
35 class QLegend;
36
36
37 class QT_CHARTS_EXPORT QLegendMarker : public QObject
37 class QT_CHARTS_EXPORT QLegendMarker : public QObject
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40
40
41 public:
41 public:
42 enum LegendMarkerType {
42 enum LegendMarkerType {
43 LegendMarkerTypeArea,
43 LegendMarkerTypeArea,
44 LegendMarkerTypeBar,
44 LegendMarkerTypeBar,
45 LegendMarkerTypePie,
45 LegendMarkerTypePie,
46 LegendMarkerTypeXY,
46 LegendMarkerTypeXY,
47 LegendMarkerTypeBoxPlot
47 LegendMarkerTypeBoxPlot
48 };
48 };
49
49
50 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
50 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
51 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
51 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
52 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
52 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
53 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
53 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
54 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
54 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
55 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
55 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
56 Q_ENUMS(LegendMarkerType)
56 Q_ENUMS(LegendMarkerType)
57
57
58 public:
58 public:
59 virtual ~QLegendMarker();
59 virtual ~QLegendMarker();
60 virtual LegendMarkerType type() = 0;
60 virtual LegendMarkerType type() = 0;
61
61
62 QString label() const;
62 QString label() const;
63 void setLabel(const QString &label);
63 void setLabel(const QString &label);
64
64
65 QBrush labelBrush() const;
65 QBrush labelBrush() const;
66 void setLabelBrush(const QBrush &brush);
66 void setLabelBrush(const QBrush &brush);
67
67
68 QFont font() const;
68 QFont font() const;
69 void setFont(const QFont &font);
69 void setFont(const QFont &font);
70
70
71 QPen pen() const;
71 QPen pen() const;
72 void setPen(const QPen &pen);
72 void setPen(const QPen &pen);
73
73
74 QBrush brush() const;
74 QBrush brush() const;
75 void setBrush(const QBrush &brush);
75 void setBrush(const QBrush &brush);
76
76
77 bool isVisible() const;
77 bool isVisible() const;
78 void setVisible(bool visible);
78 void setVisible(bool visible);
79
79
80 virtual QAbstractSeries* series() = 0;
80 virtual QAbstractSeries* series() = 0;
81
81
82 Q_SIGNALS:
82 Q_SIGNALS:
83 void clicked();
83 void clicked();
84 void hovered(bool status);
84 void hovered(bool status);
85 void labelChanged();
85 void labelChanged();
86 void labelBrushChanged();
86 void labelBrushChanged();
87 void fontChanged();
87 void fontChanged();
88 void penChanged();
88 void penChanged();
89 void brushChanged();
89 void brushChanged();
90 void visibleChanged();
90 void visibleChanged();
91
91
92 protected:
92 protected:
93 explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0);
93 explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
94
94
95 QScopedPointer<QLegendMarkerPrivate> d_ptr;
95 QScopedPointer<QLegendMarkerPrivate> d_ptr;
96 friend class QLegendPrivate;
96 friend class QLegendPrivate;
97 friend class QLegendMarkerPrivate;
97 friend class QLegendMarkerPrivate;
98 friend class LegendMarkerItem;
98 friend class LegendMarkerItem;
99 friend class LegendLayout;
99 friend class LegendLayout;
100 friend class LegendScroller;
100 friend class LegendScroller;
101
101
102 private:
102 private:
103 Q_DISABLE_COPY(QLegendMarker)
103 Q_DISABLE_COPY(QLegendMarker)
104 };
104 };
105
105
106 QT_CHARTS_END_NAMESPACE
106 QT_CHARTS_END_NAMESPACE
107
107
108 #endif // QLEGENDMARKER_H
108 #endif // QLEGENDMARKER_H
@@ -1,58 +1,58
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPIELEGENDMARKER_H
22 #ifndef QPIELEGENDMARKER_H
23 #define QPIELEGENDMARKER_H
23 #define QPIELEGENDMARKER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QLegendMarker>
26 #include <QtCharts/QLegendMarker>
27 #include <QtCharts/QPieSeries>
27 #include <QtCharts/QPieSeries>
28 #include <QtCharts/QPieSlice>
28 #include <QtCharts/QPieSlice>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31
31
32 class QPieLegendMarkerPrivate;
32 class QPieLegendMarkerPrivate;
33
33
34 class QT_CHARTS_EXPORT QPieLegendMarker : public QLegendMarker
34 class QT_CHARTS_EXPORT QPieLegendMarker : public QLegendMarker
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37
37
38 public:
38 public:
39 explicit QPieLegendMarker(QPieSeries *series, QPieSlice *slice, QLegend *legend, QObject *parent = 0);
39 explicit QPieLegendMarker(QPieSeries *series, QPieSlice *slice, QLegend *legend, QObject *parent = Q_NULLPTR);
40 virtual ~QPieLegendMarker();
40 virtual ~QPieLegendMarker();
41
41
42 virtual LegendMarkerType type() { return LegendMarkerTypePie; }
42 virtual LegendMarkerType type() { return LegendMarkerTypePie; }
43
43
44 // Related series and slice
44 // Related series and slice
45 virtual QPieSeries* series();
45 virtual QPieSeries* series();
46 QPieSlice* slice();
46 QPieSlice* slice();
47
47
48 protected:
48 protected:
49 QPieLegendMarker(QPieLegendMarkerPrivate &d, QObject *parent = 0);
49 QPieLegendMarker(QPieLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
50
50
51 private:
51 private:
52 Q_DECLARE_PRIVATE(QPieLegendMarker)
52 Q_DECLARE_PRIVATE(QPieLegendMarker)
53 Q_DISABLE_COPY(QPieLegendMarker)
53 Q_DISABLE_COPY(QPieLegendMarker)
54
54
55 };
55 };
56
56
57 QT_CHARTS_END_NAMESPACE
57 QT_CHARTS_END_NAMESPACE
58 #endif // QPIELEGENDMARKER_H
58 #endif // QPIELEGENDMARKER_H
@@ -1,56 +1,56
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QXYLEGENDMARKER_H
22 #ifndef QXYLEGENDMARKER_H
23 #define QXYLEGENDMARKER_H
23 #define QXYLEGENDMARKER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QLegendMarker>
26 #include <QtCharts/QLegendMarker>
27 #include <QtCharts/QXYSeries>
27 #include <QtCharts/QXYSeries>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QXYLegendMarkerPrivate;
31 class QXYLegendMarkerPrivate;
32
32
33 class QT_CHARTS_EXPORT QXYLegendMarker : public QLegendMarker
33 class QT_CHARTS_EXPORT QXYLegendMarker : public QLegendMarker
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 public:
36 public:
37 explicit QXYLegendMarker(QXYSeries *series, QLegend *legend, QObject *parent = 0);
37 explicit QXYLegendMarker(QXYSeries *series, QLegend *legend, QObject *parent = Q_NULLPTR);
38 virtual ~QXYLegendMarker();
38 virtual ~QXYLegendMarker();
39
39
40 virtual LegendMarkerType type() { return LegendMarkerTypeXY; }
40 virtual LegendMarkerType type() { return LegendMarkerTypeXY; }
41
41
42 // Related series
42 // Related series
43 virtual QXYSeries* series();
43 virtual QXYSeries* series();
44
44
45 protected:
45 protected:
46 QXYLegendMarker(QXYLegendMarkerPrivate &d, QObject *parent = 0);
46 QXYLegendMarker(QXYLegendMarkerPrivate &d, QObject *parent = Q_NULLPTR);
47
47
48 private:
48 private:
49 Q_DECLARE_PRIVATE(QXYLegendMarker)
49 Q_DECLARE_PRIVATE(QXYLegendMarker)
50 Q_DISABLE_COPY(QXYLegendMarker)
50 Q_DISABLE_COPY(QXYLegendMarker)
51
51
52 };
52 };
53
53
54 QT_CHARTS_END_NAMESPACE
54 QT_CHARTS_END_NAMESPACE
55
55
56 #endif // QXYLEGENDMARKER_H
56 #endif // QXYLEGENDMARKER_H
@@ -1,53 +1,53
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QLINESERIES_H
22 #ifndef QLINESERIES_H
23 #define QLINESERIES_H
23 #define QLINESERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QXYSeries>
26 #include <QtCharts/QXYSeries>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28
28
29 QT_CHARTS_BEGIN_NAMESPACE
29 QT_CHARTS_BEGIN_NAMESPACE
30
30
31 class QLineSeriesPrivate;
31 class QLineSeriesPrivate;
32
32
33 class QT_CHARTS_EXPORT QLineSeries : public QXYSeries
33 class QT_CHARTS_EXPORT QLineSeries : public QXYSeries
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36
36
37 public:
37 public:
38 explicit QLineSeries(QObject *parent = 0);
38 explicit QLineSeries(QObject *parent = Q_NULLPTR);
39 ~QLineSeries();
39 ~QLineSeries();
40 QAbstractSeries::SeriesType type() const;
40 QAbstractSeries::SeriesType type() const;
41
41
42 protected:
42 protected:
43 QLineSeries(QLineSeriesPrivate &d, QObject *parent = 0);
43 QLineSeries(QLineSeriesPrivate &d, QObject *parent = Q_NULLPTR);
44
44
45 private:
45 private:
46 Q_DECLARE_PRIVATE(QLineSeries)
46 Q_DECLARE_PRIVATE(QLineSeries)
47 Q_DISABLE_COPY(QLineSeries)
47 Q_DISABLE_COPY(QLineSeries)
48 friend class LineChartItem;
48 friend class LineChartItem;
49 };
49 };
50
50
51 QT_CHARTS_END_NAMESPACE
51 QT_CHARTS_END_NAMESPACE
52
52
53 #endif // QLINESERIES_H
53 #endif // QLINESERIES_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHPIEMODELMAPPER_H
22 #ifndef QHPIEMODELMAPPER_H
23 #define QHPIEMODELMAPPER_H
23 #define QHPIEMODELMAPPER_H
24
24
25 #include <QtCharts/QPieModelMapper>
25 #include <QtCharts/QPieModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QHPieModelMapper : public QPieModelMapper
29 class QT_CHARTS_EXPORT QHPieModelMapper : public QPieModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QPieSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QPieSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int valuesRow READ valuesRow WRITE setValuesRow NOTIFY valuesRowChanged)
34 Q_PROPERTY(int valuesRow READ valuesRow WRITE setValuesRow NOTIFY valuesRowChanged)
35 Q_PROPERTY(int labelsRow READ labelsRow WRITE setLabelsRow NOTIFY labelsRowChanged)
35 Q_PROPERTY(int labelsRow READ labelsRow WRITE setLabelsRow NOTIFY labelsRowChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
38
38
39 public:
39 public:
40 explicit QHPieModelMapper(QObject *parent = 0);
40 explicit QHPieModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QPieSeries *series() const;
45 QPieSeries *series() const;
46 void setSeries(QPieSeries *series);
46 void setSeries(QPieSeries *series);
47
47
48 int valuesRow() const;
48 int valuesRow() const;
49 void setValuesRow(int valuesRow);
49 void setValuesRow(int valuesRow);
50
50
51 int labelsRow() const;
51 int labelsRow() const;
52 void setLabelsRow(int labelsRow);
52 void setLabelsRow(int labelsRow);
53
53
54 int firstColumn() const;
54 int firstColumn() const;
55 void setFirstColumn(int firstColumn);
55 void setFirstColumn(int firstColumn);
56
56
57 int columnCount() const;
57 int columnCount() const;
58 void setColumnCount(int columnCount);
58 void setColumnCount(int columnCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void valuesRowChanged();
63 void valuesRowChanged();
64 void labelsRowChanged();
64 void labelsRowChanged();
65 void firstColumnChanged();
65 void firstColumnChanged();
66 void columnCountChanged();
66 void columnCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QHPIEMODELMAPPER_H
71 #endif // QHPIEMODELMAPPER_H
@@ -1,72 +1,72
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPIEMODELMAPPER_H
22 #ifndef QPIEMODELMAPPER_H
23 #define QPIEMODELMAPPER_H
23 #define QPIEMODELMAPPER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27
27
28 QT_BEGIN_NAMESPACE
28 QT_BEGIN_NAMESPACE
29 class QAbstractItemModel;
29 class QAbstractItemModel;
30 QT_END_NAMESPACE
30 QT_END_NAMESPACE
31
31
32 QT_CHARTS_BEGIN_NAMESPACE
32 QT_CHARTS_BEGIN_NAMESPACE
33
33
34 class QPieModelMapperPrivate;
34 class QPieModelMapperPrivate;
35 class QPieSeries;
35 class QPieSeries;
36
36
37 class QT_CHARTS_EXPORT QPieModelMapper : public QObject
37 class QT_CHARTS_EXPORT QPieModelMapper : public QObject
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40
40
41 protected:
41 protected:
42 explicit QPieModelMapper(QObject *parent = 0);
42 explicit QPieModelMapper(QObject *parent = Q_NULLPTR);
43
43
44 QAbstractItemModel *model() const;
44 QAbstractItemModel *model() const;
45 void setModel(QAbstractItemModel *model);
45 void setModel(QAbstractItemModel *model);
46
46
47 QPieSeries *series() const;
47 QPieSeries *series() const;
48 void setSeries(QPieSeries *series);
48 void setSeries(QPieSeries *series);
49
49
50 int first() const;
50 int first() const;
51 void setFirst(int first);
51 void setFirst(int first);
52
52
53 int count() const;
53 int count() const;
54 void setCount(int count);
54 void setCount(int count);
55
55
56 int valuesSection() const;
56 int valuesSection() const;
57 void setValuesSection(int valuesSection);
57 void setValuesSection(int valuesSection);
58
58
59 int labelsSection() const;
59 int labelsSection() const;
60 void setLabelsSection(int labelsSection);
60 void setLabelsSection(int labelsSection);
61
61
62 Qt::Orientation orientation() const;
62 Qt::Orientation orientation() const;
63 void setOrientation(Qt::Orientation orientation);
63 void setOrientation(Qt::Orientation orientation);
64
64
65 protected:
65 protected:
66 QPieModelMapperPrivate * const d_ptr;
66 QPieModelMapperPrivate * const d_ptr;
67 Q_DECLARE_PRIVATE(QPieModelMapper)
67 Q_DECLARE_PRIVATE(QPieModelMapper)
68 };
68 };
69
69
70 QT_CHARTS_END_NAMESPACE
70 QT_CHARTS_END_NAMESPACE
71
71
72 #endif // QPIEMODELMAPPER_H
72 #endif // QPIEMODELMAPPER_H
@@ -1,107 +1,107
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPIESERIES_H
22 #ifndef QPIESERIES_H
23 #define QPIESERIES_H
23 #define QPIESERIES_H
24
24
25 #include <QtCharts/QAbstractSeries>
25 #include <QtCharts/QAbstractSeries>
26 #include <QtCharts/QPieSlice>
26 #include <QtCharts/QPieSlice>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29 class QPieSeriesPrivate;
29 class QPieSeriesPrivate;
30
30
31 class QT_CHARTS_EXPORT QPieSeries : public QAbstractSeries
31 class QT_CHARTS_EXPORT QPieSeries : public QAbstractSeries
32 {
32 {
33 Q_OBJECT
33 Q_OBJECT
34 Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition)
34 Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition)
35 Q_PROPERTY(qreal verticalPosition READ verticalPosition WRITE setVerticalPosition)
35 Q_PROPERTY(qreal verticalPosition READ verticalPosition WRITE setVerticalPosition)
36 Q_PROPERTY(qreal size READ pieSize WRITE setPieSize)
36 Q_PROPERTY(qreal size READ pieSize WRITE setPieSize)
37 Q_PROPERTY(qreal startAngle READ pieStartAngle WRITE setPieStartAngle)
37 Q_PROPERTY(qreal startAngle READ pieStartAngle WRITE setPieStartAngle)
38 Q_PROPERTY(qreal endAngle READ pieEndAngle WRITE setPieEndAngle)
38 Q_PROPERTY(qreal endAngle READ pieEndAngle WRITE setPieEndAngle)
39 Q_PROPERTY(int count READ count NOTIFY countChanged)
39 Q_PROPERTY(int count READ count NOTIFY countChanged)
40 Q_PROPERTY(qreal sum READ sum NOTIFY sumChanged)
40 Q_PROPERTY(qreal sum READ sum NOTIFY sumChanged)
41 Q_PROPERTY(qreal holeSize READ holeSize WRITE setHoleSize)
41 Q_PROPERTY(qreal holeSize READ holeSize WRITE setHoleSize)
42
42
43 public:
43 public:
44 explicit QPieSeries(QObject *parent = 0);
44 explicit QPieSeries(QObject *parent = Q_NULLPTR);
45 virtual ~QPieSeries();
45 virtual ~QPieSeries();
46
46
47 QAbstractSeries::SeriesType type() const;
47 QAbstractSeries::SeriesType type() const;
48
48
49 bool append(QPieSlice *slice);
49 bool append(QPieSlice *slice);
50 bool append(QList<QPieSlice *> slices);
50 bool append(QList<QPieSlice *> slices);
51 QPieSeries &operator << (QPieSlice *slice);
51 QPieSeries &operator << (QPieSlice *slice);
52 QPieSlice *append(QString label, qreal value);
52 QPieSlice *append(QString label, qreal value);
53
53
54 bool insert(int index, QPieSlice *slice);
54 bool insert(int index, QPieSlice *slice);
55
55
56 bool remove(QPieSlice *slice);
56 bool remove(QPieSlice *slice);
57 bool take(QPieSlice *slice);
57 bool take(QPieSlice *slice);
58 void clear();
58 void clear();
59
59
60 QList<QPieSlice *> slices() const;
60 QList<QPieSlice *> slices() const;
61 int count() const;
61 int count() const;
62
62
63 bool isEmpty() const;
63 bool isEmpty() const;
64
64
65 qreal sum() const;
65 qreal sum() const;
66
66
67 void setHoleSize(qreal holeSize);
67 void setHoleSize(qreal holeSize);
68 qreal holeSize() const;
68 qreal holeSize() const;
69
69
70 void setHorizontalPosition(qreal relativePosition);
70 void setHorizontalPosition(qreal relativePosition);
71 qreal horizontalPosition() const;
71 qreal horizontalPosition() const;
72
72
73 void setVerticalPosition(qreal relativePosition);
73 void setVerticalPosition(qreal relativePosition);
74 qreal verticalPosition() const;
74 qreal verticalPosition() const;
75
75
76 void setPieSize(qreal relativeSize);
76 void setPieSize(qreal relativeSize);
77 qreal pieSize() const;
77 qreal pieSize() const;
78
78
79 void setPieStartAngle(qreal startAngle);
79 void setPieStartAngle(qreal startAngle);
80 qreal pieStartAngle() const;
80 qreal pieStartAngle() const;
81
81
82 void setPieEndAngle(qreal endAngle);
82 void setPieEndAngle(qreal endAngle);
83 qreal pieEndAngle() const;
83 qreal pieEndAngle() const;
84
84
85 void setLabelsVisible(bool visible = true);
85 void setLabelsVisible(bool visible = true);
86 void setLabelsPosition(QPieSlice::LabelPosition position);
86 void setLabelsPosition(QPieSlice::LabelPosition position);
87
87
88 Q_SIGNALS:
88 Q_SIGNALS:
89 void added(QList<QPieSlice *> slices);
89 void added(QList<QPieSlice *> slices);
90 void removed(QList<QPieSlice *> slices);
90 void removed(QList<QPieSlice *> slices);
91 void clicked(QPieSlice *slice);
91 void clicked(QPieSlice *slice);
92 void hovered(QPieSlice *slice, bool state);
92 void hovered(QPieSlice *slice, bool state);
93 void pressed(QPieSlice *slice);
93 void pressed(QPieSlice *slice);
94 void released(QPieSlice *slice);
94 void released(QPieSlice *slice);
95 void doubleClicked(QPieSlice *slice);
95 void doubleClicked(QPieSlice *slice);
96 void countChanged();
96 void countChanged();
97 void sumChanged();
97 void sumChanged();
98
98
99 private:
99 private:
100 Q_DECLARE_PRIVATE(QPieSeries)
100 Q_DECLARE_PRIVATE(QPieSeries)
101 Q_DISABLE_COPY(QPieSeries)
101 Q_DISABLE_COPY(QPieSeries)
102 friend class PieChartItem;
102 friend class PieChartItem;
103 };
103 };
104
104
105 QT_CHARTS_END_NAMESPACE
105 QT_CHARTS_END_NAMESPACE
106
106
107 #endif // QPIESERIES_H
107 #endif // QPIESERIES_H
@@ -1,151 +1,151
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPIESLICE_H
22 #ifndef QPIESLICE_H
23 #define QPIESLICE_H
23 #define QPIESLICE_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28 #include <QtGui/QBrush>
28 #include <QtGui/QBrush>
29 #include <QtGui/QFont>
29 #include <QtGui/QFont>
30
30
31 QT_CHARTS_BEGIN_NAMESPACE
31 QT_CHARTS_BEGIN_NAMESPACE
32 class QPieSlicePrivate;
32 class QPieSlicePrivate;
33 class QPieSeries;
33 class QPieSeries;
34
34
35 class QT_CHARTS_EXPORT QPieSlice : public QObject
35 class QT_CHARTS_EXPORT QPieSlice : public QObject
36 {
36 {
37 Q_OBJECT
37 Q_OBJECT
38 Q_ENUMS(LabelPosition)
38 Q_ENUMS(LabelPosition)
39 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
39 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
40 Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
40 Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
41 Q_PROPERTY(bool labelVisible READ isLabelVisible WRITE setLabelVisible NOTIFY labelVisibleChanged)
41 Q_PROPERTY(bool labelVisible READ isLabelVisible WRITE setLabelVisible NOTIFY labelVisibleChanged)
42 Q_PROPERTY(LabelPosition labelPosition READ labelPosition WRITE setLabelPosition)
42 Q_PROPERTY(LabelPosition labelPosition READ labelPosition WRITE setLabelPosition)
43 Q_PROPERTY(bool exploded READ isExploded WRITE setExploded)
43 Q_PROPERTY(bool exploded READ isExploded WRITE setExploded)
44 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
44 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
45 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
45 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
46 Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged)
46 Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged)
47 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
47 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
48 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
48 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
49 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
49 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
50 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
50 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
51 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged)
51 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged)
52 Q_PROPERTY(qreal labelArmLengthFactor READ labelArmLengthFactor WRITE setLabelArmLengthFactor)
52 Q_PROPERTY(qreal labelArmLengthFactor READ labelArmLengthFactor WRITE setLabelArmLengthFactor)
53 Q_PROPERTY(qreal explodeDistanceFactor READ explodeDistanceFactor WRITE setExplodeDistanceFactor)
53 Q_PROPERTY(qreal explodeDistanceFactor READ explodeDistanceFactor WRITE setExplodeDistanceFactor)
54 Q_PROPERTY(qreal percentage READ percentage NOTIFY percentageChanged)
54 Q_PROPERTY(qreal percentage READ percentage NOTIFY percentageChanged)
55 Q_PROPERTY(qreal startAngle READ startAngle NOTIFY startAngleChanged)
55 Q_PROPERTY(qreal startAngle READ startAngle NOTIFY startAngleChanged)
56 Q_PROPERTY(qreal angleSpan READ angleSpan NOTIFY angleSpanChanged)
56 Q_PROPERTY(qreal angleSpan READ angleSpan NOTIFY angleSpanChanged)
57
57
58 public:
58 public:
59 enum LabelPosition {
59 enum LabelPosition {
60 LabelOutside,
60 LabelOutside,
61 LabelInsideHorizontal,
61 LabelInsideHorizontal,
62 LabelInsideTangential,
62 LabelInsideTangential,
63 LabelInsideNormal
63 LabelInsideNormal
64 };
64 };
65
65
66 public:
66 public:
67 explicit QPieSlice(QObject *parent = 0);
67 explicit QPieSlice(QObject *parent = Q_NULLPTR);
68 QPieSlice(QString label, qreal value, QObject *parent = 0);
68 QPieSlice(QString label, qreal value, QObject *parent = Q_NULLPTR);
69 virtual ~QPieSlice();
69 virtual ~QPieSlice();
70
70
71 void setLabel(QString label);
71 void setLabel(QString label);
72 QString label() const;
72 QString label() const;
73
73
74 void setValue(qreal value);
74 void setValue(qreal value);
75 qreal value() const;
75 qreal value() const;
76
76
77 void setLabelVisible(bool visible = true);
77 void setLabelVisible(bool visible = true);
78 bool isLabelVisible() const;
78 bool isLabelVisible() const;
79
79
80 LabelPosition labelPosition();
80 LabelPosition labelPosition();
81 void setLabelPosition(LabelPosition position);
81 void setLabelPosition(LabelPosition position);
82
82
83 void setExploded(bool exploded = true);
83 void setExploded(bool exploded = true);
84 bool isExploded() const;
84 bool isExploded() const;
85
85
86 void setPen(const QPen &pen);
86 void setPen(const QPen &pen);
87 QPen pen() const;
87 QPen pen() const;
88
88
89 QColor borderColor();
89 QColor borderColor();
90 void setBorderColor(QColor color);
90 void setBorderColor(QColor color);
91
91
92 int borderWidth();
92 int borderWidth();
93 void setBorderWidth(int width);
93 void setBorderWidth(int width);
94
94
95 void setBrush(const QBrush &brush);
95 void setBrush(const QBrush &brush);
96 QBrush brush() const;
96 QBrush brush() const;
97
97
98 QColor color();
98 QColor color();
99 void setColor(QColor color);
99 void setColor(QColor color);
100
100
101 void setLabelBrush(const QBrush &brush);
101 void setLabelBrush(const QBrush &brush);
102 QBrush labelBrush() const;
102 QBrush labelBrush() const;
103
103
104 QColor labelColor();
104 QColor labelColor();
105 void setLabelColor(QColor color);
105 void setLabelColor(QColor color);
106
106
107 void setLabelFont(const QFont &font);
107 void setLabelFont(const QFont &font);
108 QFont labelFont() const;
108 QFont labelFont() const;
109
109
110 void setLabelArmLengthFactor(qreal factor);
110 void setLabelArmLengthFactor(qreal factor);
111 qreal labelArmLengthFactor() const;
111 qreal labelArmLengthFactor() const;
112
112
113 void setExplodeDistanceFactor(qreal factor);
113 void setExplodeDistanceFactor(qreal factor);
114 qreal explodeDistanceFactor() const;
114 qreal explodeDistanceFactor() const;
115
115
116 qreal percentage() const;
116 qreal percentage() const;
117 qreal startAngle() const;
117 qreal startAngle() const;
118 qreal angleSpan() const;
118 qreal angleSpan() const;
119
119
120 QPieSeries *series() const;
120 QPieSeries *series() const;
121
121
122 Q_SIGNALS:
122 Q_SIGNALS:
123 void clicked();
123 void clicked();
124 void hovered(bool state);
124 void hovered(bool state);
125 void pressed();
125 void pressed();
126 void released();
126 void released();
127 void doubleClicked();
127 void doubleClicked();
128 void labelChanged();
128 void labelChanged();
129 void valueChanged();
129 void valueChanged();
130 void labelVisibleChanged();
130 void labelVisibleChanged();
131 void penChanged();
131 void penChanged();
132 void brushChanged();
132 void brushChanged();
133 void labelBrushChanged();
133 void labelBrushChanged();
134 void labelFontChanged();
134 void labelFontChanged();
135 void percentageChanged();
135 void percentageChanged();
136 void startAngleChanged();
136 void startAngleChanged();
137 void angleSpanChanged();
137 void angleSpanChanged();
138 void colorChanged();
138 void colorChanged();
139 void borderColorChanged();
139 void borderColorChanged();
140 void borderWidthChanged();
140 void borderWidthChanged();
141 void labelColorChanged();
141 void labelColorChanged();
142
142
143 private:
143 private:
144 QPieSlicePrivate * const d_ptr;
144 QPieSlicePrivate * const d_ptr;
145 Q_DECLARE_PRIVATE(QPieSlice)
145 Q_DECLARE_PRIVATE(QPieSlice)
146 Q_DISABLE_COPY(QPieSlice)
146 Q_DISABLE_COPY(QPieSlice)
147 };
147 };
148
148
149 QT_CHARTS_END_NAMESPACE
149 QT_CHARTS_END_NAMESPACE
150
150
151 #endif // QPIESLICE_H
151 #endif // QPIESLICE_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QVPIEMODELMAPPER_H
22 #ifndef QVPIEMODELMAPPER_H
23 #define QVPIEMODELMAPPER_H
23 #define QVPIEMODELMAPPER_H
24
24
25 #include <QtCharts/QPieModelMapper>
25 #include <QtCharts/QPieModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QVPieModelMapper : public QPieModelMapper
29 class QT_CHARTS_EXPORT QVPieModelMapper : public QPieModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QPieSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QPieSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int valuesColumn READ valuesColumn WRITE setValuesColumn NOTIFY valuesColumnChanged)
34 Q_PROPERTY(int valuesColumn READ valuesColumn WRITE setValuesColumn NOTIFY valuesColumnChanged)
35 Q_PROPERTY(int labelsColumn READ labelsColumn WRITE setLabelsColumn NOTIFY labelsColumnChanged)
35 Q_PROPERTY(int labelsColumn READ labelsColumn WRITE setLabelsColumn NOTIFY labelsColumnChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
38
38
39 public:
39 public:
40 explicit QVPieModelMapper(QObject *parent = 0);
40 explicit QVPieModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QPieSeries *series() const;
45 QPieSeries *series() const;
46 void setSeries(QPieSeries *series);
46 void setSeries(QPieSeries *series);
47
47
48 int valuesColumn() const;
48 int valuesColumn() const;
49 void setValuesColumn(int valuesColumn);
49 void setValuesColumn(int valuesColumn);
50
50
51 int labelsColumn() const;
51 int labelsColumn() const;
52 void setLabelsColumn(int labelsColumn);
52 void setLabelsColumn(int labelsColumn);
53
53
54 int firstRow() const;
54 int firstRow() const;
55 void setFirstRow(int firstRow);
55 void setFirstRow(int firstRow);
56
56
57 int rowCount() const;
57 int rowCount() const;
58 void setRowCount(int rowCount);
58 void setRowCount(int rowCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void valuesColumnChanged();
63 void valuesColumnChanged();
64 void labelsColumnChanged();
64 void labelsColumnChanged();
65 void firstRowChanged();
65 void firstRowChanged();
66 void rowCountChanged();
66 void rowCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QVPIEMODELMAPPER_H
71 #endif // QVPIEMODELMAPPER_H
@@ -1,104 +1,104
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QABSTRACTSERIES_H
22 #ifndef QABSTRACTSERIES_H
23 #define QABSTRACTSERIES_H
23 #define QABSTRACTSERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QAbstractAxis>
26 #include <QtCharts/QAbstractAxis>
27 #include <QtCore/QObject>
27 #include <QtCore/QObject>
28 #include <QtGui/QPen>
28 #include <QtGui/QPen>
29
29
30 QT_CHARTS_BEGIN_NAMESPACE
30 QT_CHARTS_BEGIN_NAMESPACE
31
31
32 class QAbstractSeriesPrivate;
32 class QAbstractSeriesPrivate;
33 class QChart;
33 class QChart;
34
34
35 class QT_CHARTS_EXPORT QAbstractSeries : public QObject
35 class QT_CHARTS_EXPORT QAbstractSeries : public QObject
36 {
36 {
37 Q_OBJECT
37 Q_OBJECT
38 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
38 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
39 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
39 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
40 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
40 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
41 Q_PROPERTY(SeriesType type READ type)
41 Q_PROPERTY(SeriesType type READ type)
42 Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged)
42 Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged)
43 Q_ENUMS(SeriesType)
43 Q_ENUMS(SeriesType)
44
44
45 public:
45 public:
46 enum SeriesType {
46 enum SeriesType {
47 SeriesTypeLine,
47 SeriesTypeLine,
48 SeriesTypeArea,
48 SeriesTypeArea,
49 SeriesTypeBar,
49 SeriesTypeBar,
50 SeriesTypeStackedBar,
50 SeriesTypeStackedBar,
51 SeriesTypePercentBar,
51 SeriesTypePercentBar,
52 SeriesTypePie,
52 SeriesTypePie,
53 SeriesTypeScatter,
53 SeriesTypeScatter,
54 SeriesTypeSpline,
54 SeriesTypeSpline,
55 SeriesTypeHorizontalBar,
55 SeriesTypeHorizontalBar,
56 SeriesTypeHorizontalStackedBar,
56 SeriesTypeHorizontalStackedBar,
57 SeriesTypeHorizontalPercentBar,
57 SeriesTypeHorizontalPercentBar,
58 SeriesTypeBoxPlot
58 SeriesTypeBoxPlot
59 };
59 };
60
60
61 protected:
61 protected:
62 QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0);
62 QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = Q_NULLPTR);
63
63
64 public:
64 public:
65 ~QAbstractSeries();
65 ~QAbstractSeries();
66 virtual SeriesType type() const = 0;
66 virtual SeriesType type() const = 0;
67
67
68 void setName(const QString &name);
68 void setName(const QString &name);
69 QString name() const;
69 QString name() const;
70 void setVisible(bool visible = true);
70 void setVisible(bool visible = true);
71 bool isVisible() const;
71 bool isVisible() const;
72 qreal opacity() const;
72 qreal opacity() const;
73 void setOpacity(qreal opacity);
73 void setOpacity(qreal opacity);
74 void setUseOpenGL(bool enable = true);
74 void setUseOpenGL(bool enable = true);
75 bool useOpenGL() const;
75 bool useOpenGL() const;
76
76
77 QChart *chart() const;
77 QChart *chart() const;
78
78
79 bool attachAxis(QAbstractAxis *axis);
79 bool attachAxis(QAbstractAxis *axis);
80 bool detachAxis(QAbstractAxis *axis);
80 bool detachAxis(QAbstractAxis *axis);
81 QList<QAbstractAxis*> attachedAxes();
81 QList<QAbstractAxis*> attachedAxes();
82
82
83 void show();
83 void show();
84 void hide();
84 void hide();
85
85
86 Q_SIGNALS:
86 Q_SIGNALS:
87 void nameChanged();
87 void nameChanged();
88 void visibleChanged();
88 void visibleChanged();
89 void opacityChanged();
89 void opacityChanged();
90 void useOpenGLChanged();
90 void useOpenGLChanged();
91
91
92 protected:
92 protected:
93 QScopedPointer<QAbstractSeriesPrivate> d_ptr;
93 QScopedPointer<QAbstractSeriesPrivate> d_ptr;
94 friend class ChartDataSet;
94 friend class ChartDataSet;
95 friend class ChartPresenter;
95 friend class ChartPresenter;
96 friend class ChartThemeManager;
96 friend class ChartThemeManager;
97 friend class QLegendPrivate;
97 friend class QLegendPrivate;
98 friend class DeclarativeChart;
98 friend class DeclarativeChart;
99 friend class QAreaSeries;
99 friend class QAreaSeries;
100 };
100 };
101
101
102 QT_CHARTS_END_NAMESPACE
102 QT_CHARTS_END_NAMESPACE
103
103
104 #endif // QABSTRACTSERIES_H
104 #endif // QABSTRACTSERIES_H
@@ -1,195 +1,195
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QCHART_H
22 #ifndef QCHART_H
23 #define QCHART_H
23 #define QCHART_H
24
24
25 #include <QtCharts/QAbstractSeries>
25 #include <QtCharts/QAbstractSeries>
26 #include <QtCharts/QLegend>
26 #include <QtCharts/QLegend>
27 #include <QtWidgets/QGraphicsWidget>
27 #include <QtWidgets/QGraphicsWidget>
28 #include <QtCore/QMargins>
28 #include <QtCore/QMargins>
29
29
30 QT_BEGIN_NAMESPACE
30 QT_BEGIN_NAMESPACE
31 class QGraphicsSceneResizeEvent;
31 class QGraphicsSceneResizeEvent;
32 QT_END_NAMESPACE
32 QT_END_NAMESPACE
33
33
34 QT_CHARTS_BEGIN_NAMESPACE
34 QT_CHARTS_BEGIN_NAMESPACE
35
35
36 class QAbstractSeries;
36 class QAbstractSeries;
37 class QAbstractAxis;
37 class QAbstractAxis;
38 class QLegend;
38 class QLegend;
39 class QChartPrivate;
39 class QChartPrivate;
40 class QBoxPlotSeries;
40 class QBoxPlotSeries;
41
41
42 class QT_CHARTS_EXPORT QChart : public QGraphicsWidget
42 class QT_CHARTS_EXPORT QChart : public QGraphicsWidget
43 {
43 {
44 Q_OBJECT
44 Q_OBJECT
45 Q_PROPERTY(QChart::ChartTheme theme READ theme WRITE setTheme)
45 Q_PROPERTY(QChart::ChartTheme theme READ theme WRITE setTheme)
46 Q_PROPERTY(QString title READ title WRITE setTitle)
46 Q_PROPERTY(QString title READ title WRITE setTitle)
47 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible)
47 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible)
48 Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled)
48 Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled)
49 Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness)
49 Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness)
50 Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions)
50 Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions)
51 Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration)
51 Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration)
52 Q_PROPERTY(QEasingCurve animationEasingCurve READ animationEasingCurve WRITE setAnimationEasingCurve)
52 Q_PROPERTY(QEasingCurve animationEasingCurve READ animationEasingCurve WRITE setAnimationEasingCurve)
53 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
53 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
54 Q_PROPERTY(QChart::ChartType chartType READ chartType)
54 Q_PROPERTY(QChart::ChartType chartType READ chartType)
55 Q_PROPERTY(bool plotAreaBackgroundVisible READ isPlotAreaBackgroundVisible WRITE setPlotAreaBackgroundVisible)
55 Q_PROPERTY(bool plotAreaBackgroundVisible READ isPlotAreaBackgroundVisible WRITE setPlotAreaBackgroundVisible)
56 Q_PROPERTY(bool localizeNumbers READ localizeNumbers WRITE setLocalizeNumbers)
56 Q_PROPERTY(bool localizeNumbers READ localizeNumbers WRITE setLocalizeNumbers)
57 Q_PROPERTY(QLocale locale READ locale WRITE setLocale)
57 Q_PROPERTY(QLocale locale READ locale WRITE setLocale)
58 Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged)
58 Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged)
59 Q_ENUMS(ChartTheme)
59 Q_ENUMS(ChartTheme)
60 Q_ENUMS(AnimationOption)
60 Q_ENUMS(AnimationOption)
61 Q_ENUMS(ChartType)
61 Q_ENUMS(ChartType)
62
62
63 public:
63 public:
64 enum ChartType {
64 enum ChartType {
65 ChartTypeUndefined = 0,
65 ChartTypeUndefined = 0,
66 ChartTypeCartesian,
66 ChartTypeCartesian,
67 ChartTypePolar
67 ChartTypePolar
68 };
68 };
69
69
70 enum ChartTheme {
70 enum ChartTheme {
71 ChartThemeLight = 0,
71 ChartThemeLight = 0,
72 ChartThemeBlueCerulean,
72 ChartThemeBlueCerulean,
73 ChartThemeDark,
73 ChartThemeDark,
74 ChartThemeBrownSand,
74 ChartThemeBrownSand,
75 ChartThemeBlueNcs,
75 ChartThemeBlueNcs,
76 ChartThemeHighContrast,
76 ChartThemeHighContrast,
77 ChartThemeBlueIcy,
77 ChartThemeBlueIcy,
78 ChartThemeQt
78 ChartThemeQt
79 };
79 };
80
80
81 enum AnimationOption {
81 enum AnimationOption {
82 NoAnimation = 0x0,
82 NoAnimation = 0x0,
83 GridAxisAnimations = 0x1,
83 GridAxisAnimations = 0x1,
84 SeriesAnimations = 0x2,
84 SeriesAnimations = 0x2,
85 AllAnimations = 0x3
85 AllAnimations = 0x3
86 };
86 };
87
87
88 Q_DECLARE_FLAGS(AnimationOptions, AnimationOption)
88 Q_DECLARE_FLAGS(AnimationOptions, AnimationOption)
89
89
90 public:
90 public:
91 explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
91 explicit QChart(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
92 ~QChart();
92 ~QChart();
93
93
94 void addSeries(QAbstractSeries *series);
94 void addSeries(QAbstractSeries *series);
95 void removeSeries(QAbstractSeries *series);
95 void removeSeries(QAbstractSeries *series);
96 void removeAllSeries();
96 void removeAllSeries();
97 QList<QAbstractSeries *> series() const;
97 QList<QAbstractSeries *> series() const;
98
98
99 // *** deprecated ***
99 // *** deprecated ***
100 void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0);
100 void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = Q_NULLPTR);
101 void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0);
101 void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = Q_NULLPTR);
102 QAbstractAxis *axisX(QAbstractSeries *series = 0) const;
102 QAbstractAxis *axisX(QAbstractSeries *series = Q_NULLPTR) const;
103 QAbstractAxis *axisY(QAbstractSeries *series = 0) const;
103 QAbstractAxis *axisY(QAbstractSeries *series = Q_NULLPTR) const;
104 // ******************
104 // ******************
105
105
106 void addAxis(QAbstractAxis *axis, Qt::Alignment alignment);
106 void addAxis(QAbstractAxis *axis, Qt::Alignment alignment);
107 void removeAxis(QAbstractAxis *axis);
107 void removeAxis(QAbstractAxis *axis);
108 QList<QAbstractAxis*> axes(Qt::Orientations orientation = Qt::Horizontal|Qt::Vertical, QAbstractSeries *series = 0) const;
108 QList<QAbstractAxis*> axes(Qt::Orientations orientation = Qt::Horizontal|Qt::Vertical, QAbstractSeries *series = Q_NULLPTR) const;
109
109
110 void createDefaultAxes();
110 void createDefaultAxes();
111
111
112 void setTheme(QChart::ChartTheme theme);
112 void setTheme(QChart::ChartTheme theme);
113 QChart::ChartTheme theme() const;
113 QChart::ChartTheme theme() const;
114
114
115 void setTitle(const QString &title);
115 void setTitle(const QString &title);
116 QString title() const;
116 QString title() const;
117 void setTitleFont(const QFont &font);
117 void setTitleFont(const QFont &font);
118 QFont titleFont() const;
118 QFont titleFont() const;
119 void setTitleBrush(const QBrush &brush);
119 void setTitleBrush(const QBrush &brush);
120 QBrush titleBrush() const;
120 QBrush titleBrush() const;
121
121
122 void setBackgroundBrush(const QBrush &brush);
122 void setBackgroundBrush(const QBrush &brush);
123 QBrush backgroundBrush() const;
123 QBrush backgroundBrush() const;
124 void setBackgroundPen(const QPen &pen);
124 void setBackgroundPen(const QPen &pen);
125 QPen backgroundPen() const;
125 QPen backgroundPen() const;
126 void setBackgroundVisible(bool visible = true);
126 void setBackgroundVisible(bool visible = true);
127 bool isBackgroundVisible() const;
127 bool isBackgroundVisible() const;
128
128
129 void setDropShadowEnabled(bool enabled = true);
129 void setDropShadowEnabled(bool enabled = true);
130 bool isDropShadowEnabled() const;
130 bool isDropShadowEnabled() const;
131 void setBackgroundRoundness(qreal diameter);
131 void setBackgroundRoundness(qreal diameter);
132 qreal backgroundRoundness() const;
132 qreal backgroundRoundness() const;
133
133
134 void setAnimationOptions(AnimationOptions options);
134 void setAnimationOptions(AnimationOptions options);
135 AnimationOptions animationOptions() const;
135 AnimationOptions animationOptions() const;
136 void setAnimationDuration(int msecs);
136 void setAnimationDuration(int msecs);
137 int animationDuration() const;
137 int animationDuration() const;
138 void setAnimationEasingCurve(const QEasingCurve &curve);
138 void setAnimationEasingCurve(const QEasingCurve &curve);
139 QEasingCurve animationEasingCurve() const;
139 QEasingCurve animationEasingCurve() const;
140
140
141 void zoomIn();
141 void zoomIn();
142 void zoomOut();
142 void zoomOut();
143
143
144 void zoomIn(const QRectF &rect);
144 void zoomIn(const QRectF &rect);
145 void zoom(qreal factor);
145 void zoom(qreal factor);
146 void zoomReset();
146 void zoomReset();
147 bool isZoomed();
147 bool isZoomed();
148
148
149 void scroll(qreal dx, qreal dy);
149 void scroll(qreal dx, qreal dy);
150
150
151 QLegend *legend() const;
151 QLegend *legend() const;
152
152
153 void setMargins(const QMargins &margins);
153 void setMargins(const QMargins &margins);
154 QMargins margins() const;
154 QMargins margins() const;
155
155
156 QRectF plotArea() const;
156 QRectF plotArea() const;
157 void setPlotAreaBackgroundBrush(const QBrush &brush);
157 void setPlotAreaBackgroundBrush(const QBrush &brush);
158 QBrush plotAreaBackgroundBrush() const;
158 QBrush plotAreaBackgroundBrush() const;
159 void setPlotAreaBackgroundPen(const QPen &pen);
159 void setPlotAreaBackgroundPen(const QPen &pen);
160 QPen plotAreaBackgroundPen() const;
160 QPen plotAreaBackgroundPen() const;
161 void setPlotAreaBackgroundVisible(bool visible = true);
161 void setPlotAreaBackgroundVisible(bool visible = true);
162 bool isPlotAreaBackgroundVisible() const;
162 bool isPlotAreaBackgroundVisible() const;
163 void setLocalizeNumbers(bool localize);
163 void setLocalizeNumbers(bool localize);
164 bool localizeNumbers() const;
164 bool localizeNumbers() const;
165 void setLocale(const QLocale &locale);
165 void setLocale(const QLocale &locale);
166 QLocale locale() const;
166 QLocale locale() const;
167
167
168 QPointF mapToValue(const QPointF &position, QAbstractSeries *series = 0);
168 QPointF mapToValue(const QPointF &position, QAbstractSeries *series = Q_NULLPTR);
169 QPointF mapToPosition(const QPointF &value, QAbstractSeries *series = 0);
169 QPointF mapToPosition(const QPointF &value, QAbstractSeries *series = Q_NULLPTR);
170
170
171 ChartType chartType() const;
171 ChartType chartType() const;
172
172
173 Q_SIGNALS:
173 Q_SIGNALS:
174 void plotAreaChanged(const QRectF &plotArea);
174 void plotAreaChanged(const QRectF &plotArea);
175
175
176 protected:
176 protected:
177 explicit QChart(QChart::ChartType type, QGraphicsItem *parent, Qt::WindowFlags wFlags);
177 explicit QChart(QChart::ChartType type, QGraphicsItem *parent, Qt::WindowFlags wFlags);
178 QScopedPointer<QChartPrivate> d_ptr;
178 QScopedPointer<QChartPrivate> d_ptr;
179 friend class QLegend;
179 friend class QLegend;
180 friend class DeclarativeChart;
180 friend class DeclarativeChart;
181 friend class ChartDataSet;
181 friend class ChartDataSet;
182 friend class ChartPresenter;
182 friend class ChartPresenter;
183 friend class ChartThemeManager;
183 friend class ChartThemeManager;
184 friend class QAbstractSeries;
184 friend class QAbstractSeries;
185 friend class QBoxPlotSeriesPrivate;
185 friend class QBoxPlotSeriesPrivate;
186
186
187 private:
187 private:
188 Q_DISABLE_COPY(QChart)
188 Q_DISABLE_COPY(QChart)
189 };
189 };
190
190
191 QT_CHARTS_END_NAMESPACE
191 QT_CHARTS_END_NAMESPACE
192
192
193 Q_DECLARE_OPERATORS_FOR_FLAGS(QT_CHARTS_NAMESPACE::QChart::AnimationOptions)
193 Q_DECLARE_OPERATORS_FOR_FLAGS(QT_CHARTS_NAMESPACE::QChart::AnimationOptions)
194
194
195 #endif // QCHART_H
195 #endif // QCHART_H
@@ -1,78 +1,78
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QCHARTVIEW_H
22 #ifndef QCHARTVIEW_H
23 #define QCHARTVIEW_H
23 #define QCHARTVIEW_H
24
24
25 #include <QtCharts/QAbstractAxis>
25 #include <QtCharts/QAbstractAxis>
26 #include <QtCharts/QAbstractSeries>
26 #include <QtCharts/QAbstractSeries>
27 #include <QtCharts/QChart>
27 #include <QtCharts/QChart>
28 #include <QtWidgets/QGraphicsView>
28 #include <QtWidgets/QGraphicsView>
29
29
30 QT_BEGIN_NAMESPACE
30 QT_BEGIN_NAMESPACE
31 class QGraphicsScene;
31 class QGraphicsScene;
32 class QRubberBand;
32 class QRubberBand;
33 QT_END_NAMESPACE
33 QT_END_NAMESPACE
34
34
35 QT_CHARTS_BEGIN_NAMESPACE
35 QT_CHARTS_BEGIN_NAMESPACE
36
36
37 class QChartViewPrivate;
37 class QChartViewPrivate;
38
38
39 class QT_CHARTS_EXPORT QChartView : public QGraphicsView
39 class QT_CHARTS_EXPORT QChartView : public QGraphicsView
40 {
40 {
41 Q_OBJECT
41 Q_OBJECT
42 Q_ENUMS(RubberBand)
42 Q_ENUMS(RubberBand)
43 public:
43 public:
44
44
45 enum RubberBand {
45 enum RubberBand {
46 NoRubberBand = 0x0,
46 NoRubberBand = 0x0,
47 VerticalRubberBand = 0x1,
47 VerticalRubberBand = 0x1,
48 HorizontalRubberBand = 0x2,
48 HorizontalRubberBand = 0x2,
49 RectangleRubberBand = 0x3
49 RectangleRubberBand = 0x3
50 };
50 };
51
51
52 Q_DECLARE_FLAGS(RubberBands, RubberBand)
52 Q_DECLARE_FLAGS(RubberBands, RubberBand)
53
53
54 explicit QChartView(QWidget *parent = 0);
54 explicit QChartView(QWidget *parent = Q_NULLPTR);
55 explicit QChartView(QChart *chart, QWidget *parent = 0);
55 explicit QChartView(QChart *chart, QWidget *parent = Q_NULLPTR);
56 ~QChartView();
56 ~QChartView();
57
57
58 void setRubberBand(const RubberBands &rubberBands);
58 void setRubberBand(const RubberBands &rubberBands);
59 RubberBands rubberBand() const;
59 RubberBands rubberBand() const;
60
60
61 QChart *chart() const;
61 QChart *chart() const;
62 void setChart(QChart *chart);
62 void setChart(QChart *chart);
63
63
64 protected:
64 protected:
65 void resizeEvent(QResizeEvent *event);
65 void resizeEvent(QResizeEvent *event);
66 void mousePressEvent(QMouseEvent *event);
66 void mousePressEvent(QMouseEvent *event);
67 void mouseMoveEvent(QMouseEvent *event);
67 void mouseMoveEvent(QMouseEvent *event);
68 void mouseReleaseEvent(QMouseEvent *event);
68 void mouseReleaseEvent(QMouseEvent *event);
69
69
70 QScopedPointer<QChartViewPrivate> d_ptr;
70 QScopedPointer<QChartViewPrivate> d_ptr;
71
71
72 private:
72 private:
73 Q_DISABLE_COPY(QChartView)
73 Q_DISABLE_COPY(QChartView)
74 };
74 };
75
75
76 QT_CHARTS_END_NAMESPACE
76 QT_CHARTS_END_NAMESPACE
77
77
78 #endif // QCHARTVIEW_H
78 #endif // QCHARTVIEW_H
@@ -1,61 +1,61
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QPOLARCHART_H
22 #ifndef QPOLARCHART_H
23 #define QPOLARCHART_H
23 #define QPOLARCHART_H
24
24
25 #include <QtCharts/QChart>
25 #include <QtCharts/QChart>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28
28
29 class QAbstractSeries;
29 class QAbstractSeries;
30 class QAbstractAxis;
30 class QAbstractAxis;
31
31
32 class QT_CHARTS_EXPORT QPolarChart : public QChart
32 class QT_CHARTS_EXPORT QPolarChart : public QChart
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 Q_ENUMS(PolarOrientation)
35 Q_ENUMS(PolarOrientation)
36 Q_FLAGS(PolarOrientations)
36 Q_FLAGS(PolarOrientations)
37
37
38 public:
38 public:
39 enum PolarOrientation {
39 enum PolarOrientation {
40 PolarOrientationRadial = 0x1,
40 PolarOrientationRadial = 0x1,
41 PolarOrientationAngular = 0x2
41 PolarOrientationAngular = 0x2
42 };
42 };
43 Q_DECLARE_FLAGS(PolarOrientations, PolarOrientation)
43 Q_DECLARE_FLAGS(PolarOrientations, PolarOrientation)
44
44
45 public:
45 public:
46 explicit QPolarChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
46 explicit QPolarChart(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
47 ~QPolarChart();
47 ~QPolarChart();
48
48
49 void addAxis(QAbstractAxis *axis, PolarOrientation polarOrientation);
49 void addAxis(QAbstractAxis *axis, PolarOrientation polarOrientation);
50
50
51 QList<QAbstractAxis*> axes(PolarOrientations polarOrientation = PolarOrientations(PolarOrientationRadial | PolarOrientationAngular), QAbstractSeries *series = 0) const;
51 QList<QAbstractAxis*> axes(PolarOrientations polarOrientation = PolarOrientations(PolarOrientationRadial | PolarOrientationAngular), QAbstractSeries *series = Q_NULLPTR) const;
52
52
53 static PolarOrientation axisPolarOrientation(QAbstractAxis *axis);
53 static PolarOrientation axisPolarOrientation(QAbstractAxis *axis);
54
54
55 private:
55 private:
56 Q_DISABLE_COPY(QPolarChart)
56 Q_DISABLE_COPY(QPolarChart)
57 };
57 };
58
58
59 QT_CHARTS_END_NAMESPACE
59 QT_CHARTS_END_NAMESPACE
60
60
61 #endif // QCHART_H
61 #endif // QCHART_H
@@ -1,78 +1,78
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QSCATTERSERIES_H
22 #ifndef QSCATTERSERIES_H
23 #define QSCATTERSERIES_H
23 #define QSCATTERSERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/qxyseries.h>
26 #include <QtCharts/qxyseries.h>
27
27
28 QT_CHARTS_BEGIN_NAMESPACE
28 QT_CHARTS_BEGIN_NAMESPACE
29
29
30 class QScatterSeriesPrivate;
30 class QScatterSeriesPrivate;
31
31
32 class QT_CHARTS_EXPORT QScatterSeries : public QXYSeries
32 class QT_CHARTS_EXPORT QScatterSeries : public QXYSeries
33 {
33 {
34 Q_OBJECT
34 Q_OBJECT
35 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
35 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
36 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
36 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
37 Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape NOTIFY markerShapeChanged)
37 Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape NOTIFY markerShapeChanged)
38 Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize NOTIFY markerSizeChanged)
38 Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize NOTIFY markerSizeChanged)
39 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
39 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
40 Q_ENUMS(MarkerShape)
40 Q_ENUMS(MarkerShape)
41
41
42 public:
42 public:
43 enum MarkerShape {
43 enum MarkerShape {
44 MarkerShapeCircle,
44 MarkerShapeCircle,
45 MarkerShapeRectangle
45 MarkerShapeRectangle
46 };
46 };
47
47
48 public:
48 public:
49 explicit QScatterSeries(QObject *parent = 0);
49 explicit QScatterSeries(QObject *parent = Q_NULLPTR);
50 ~QScatterSeries();
50 ~QScatterSeries();
51 QAbstractSeries::SeriesType type() const;
51 QAbstractSeries::SeriesType type() const;
52 void setPen(const QPen &pen);
52 void setPen(const QPen &pen);
53 void setBrush(const QBrush &brush);
53 void setBrush(const QBrush &brush);
54 QBrush brush() const;
54 QBrush brush() const;
55 void setColor(const QColor &color);
55 void setColor(const QColor &color);
56 QColor color() const;
56 QColor color() const;
57 void setBorderColor(const QColor &color);
57 void setBorderColor(const QColor &color);
58 QColor borderColor() const;
58 QColor borderColor() const;
59 MarkerShape markerShape() const;
59 MarkerShape markerShape() const;
60 void setMarkerShape(MarkerShape shape);
60 void setMarkerShape(MarkerShape shape);
61 qreal markerSize() const;
61 qreal markerSize() const;
62 void setMarkerSize(qreal size);
62 void setMarkerSize(qreal size);
63
63
64 Q_SIGNALS:
64 Q_SIGNALS:
65 void colorChanged(QColor color);
65 void colorChanged(QColor color);
66 void borderColorChanged(QColor color);
66 void borderColorChanged(QColor color);
67 void markerShapeChanged(MarkerShape shape);
67 void markerShapeChanged(MarkerShape shape);
68 void markerSizeChanged(qreal size);
68 void markerSizeChanged(qreal size);
69
69
70 private:
70 private:
71 Q_DECLARE_PRIVATE(QScatterSeries)
71 Q_DECLARE_PRIVATE(QScatterSeries)
72 Q_DISABLE_COPY(QScatterSeries)
72 Q_DISABLE_COPY(QScatterSeries)
73 friend class ScatterChartItem;
73 friend class ScatterChartItem;
74 };
74 };
75
75
76 QT_CHARTS_END_NAMESPACE
76 QT_CHARTS_END_NAMESPACE
77
77
78 #endif // QSCATTERSERIES_H
78 #endif // QSCATTERSERIES_H
@@ -1,52 +1,52
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QSPLINESERIES_H
22 #ifndef QSPLINESERIES_H
23 #define QSPLINESERIES_H
23 #define QSPLINESERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/qlineseries.h>
26 #include <QtCharts/qlineseries.h>
27 #include <QtCore/QList>
27 #include <QtCore/QList>
28 #include <QtCore/QPointF>
28 #include <QtCore/QPointF>
29 #include <QtCore/QtGlobal>
29 #include <QtCore/QtGlobal>
30
30
31 QT_CHARTS_BEGIN_NAMESPACE
31 QT_CHARTS_BEGIN_NAMESPACE
32
32
33 class QSplineSeriesPrivate;
33 class QSplineSeriesPrivate;
34
34
35 class QT_CHARTS_EXPORT QSplineSeries : public QLineSeries
35 class QT_CHARTS_EXPORT QSplineSeries : public QLineSeries
36 {
36 {
37 Q_OBJECT
37 Q_OBJECT
38
38
39 public:
39 public:
40 explicit QSplineSeries(QObject *parent = 0);
40 explicit QSplineSeries(QObject *parent = Q_NULLPTR);
41 ~QSplineSeries();
41 ~QSplineSeries();
42 QAbstractSeries::SeriesType type() const;
42 QAbstractSeries::SeriesType type() const;
43
43
44 private:
44 private:
45 Q_DECLARE_PRIVATE(QSplineSeries)
45 Q_DECLARE_PRIVATE(QSplineSeries)
46 Q_DISABLE_COPY(QSplineSeries)
46 Q_DISABLE_COPY(QSplineSeries)
47 friend class SplineChartItem;
47 friend class SplineChartItem;
48 };
48 };
49
49
50 QT_CHARTS_END_NAMESPACE
50 QT_CHARTS_END_NAMESPACE
51
51
52 #endif // QSPLINESERIES_H
52 #endif // QSPLINESERIES_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QHXYMODELMAPPER_H
22 #ifndef QHXYMODELMAPPER_H
23 #define QHXYMODELMAPPER_H
23 #define QHXYMODELMAPPER_H
24
24
25 #include <QtCharts/QXYModelMapper>
25 #include <QtCharts/QXYModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QHXYModelMapper : public QXYModelMapper
29 class QT_CHARTS_EXPORT QHXYModelMapper : public QXYModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int xRow READ xRow WRITE setXRow NOTIFY xRowChanged)
34 Q_PROPERTY(int xRow READ xRow WRITE setXRow NOTIFY xRowChanged)
35 Q_PROPERTY(int yRow READ yRow WRITE setYRow NOTIFY yRowChanged)
35 Q_PROPERTY(int yRow READ yRow WRITE setYRow NOTIFY yRowChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
36 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
37 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
38
38
39 public:
39 public:
40 explicit QHXYModelMapper(QObject *parent = 0);
40 explicit QHXYModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QXYSeries *series() const;
45 QXYSeries *series() const;
46 void setSeries(QXYSeries *series);
46 void setSeries(QXYSeries *series);
47
47
48 int xRow() const;
48 int xRow() const;
49 void setXRow(int xRow);
49 void setXRow(int xRow);
50
50
51 int yRow() const;
51 int yRow() const;
52 void setYRow(int yRow);
52 void setYRow(int yRow);
53
53
54 int firstColumn() const;
54 int firstColumn() const;
55 void setFirstColumn(int firstColumn);
55 void setFirstColumn(int firstColumn);
56
56
57 int columnCount() const;
57 int columnCount() const;
58 void setColumnCount(int columnCount);
58 void setColumnCount(int columnCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void xRowChanged();
63 void xRowChanged();
64 void yRowChanged();
64 void yRowChanged();
65 void firstColumnChanged();
65 void firstColumnChanged();
66 void columnCountChanged();
66 void columnCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QHXYMODELMAPPER_H
71 #endif // QHXYMODELMAPPER_H
@@ -1,71 +1,71
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QVXYMODELMAPPER_H
22 #ifndef QVXYMODELMAPPER_H
23 #define QVXYMODELMAPPER_H
23 #define QVXYMODELMAPPER_H
24
24
25 #include <QtCharts/QXYModelMapper>
25 #include <QtCharts/QXYModelMapper>
26
26
27 QT_CHARTS_BEGIN_NAMESPACE
27 QT_CHARTS_BEGIN_NAMESPACE
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
28 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
29 class QT_CHARTS_EXPORT QVXYModelMapper : public QXYModelMapper
29 class QT_CHARTS_EXPORT QVXYModelMapper : public QXYModelMapper
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
32 Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
33 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
34 Q_PROPERTY(int xColumn READ xColumn WRITE setXColumn NOTIFY xColumnChanged)
34 Q_PROPERTY(int xColumn READ xColumn WRITE setXColumn NOTIFY xColumnChanged)
35 Q_PROPERTY(int yColumn READ yColumn WRITE setYColumn NOTIFY yColumnChanged)
35 Q_PROPERTY(int yColumn READ yColumn WRITE setYColumn NOTIFY yColumnChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
36 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
37 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
38
38
39 public:
39 public:
40 explicit QVXYModelMapper(QObject *parent = 0);
40 explicit QVXYModelMapper(QObject *parent = Q_NULLPTR);
41
41
42 QAbstractItemModel *model() const;
42 QAbstractItemModel *model() const;
43 void setModel(QAbstractItemModel *model);
43 void setModel(QAbstractItemModel *model);
44
44
45 QXYSeries *series() const;
45 QXYSeries *series() const;
46 void setSeries(QXYSeries *series);
46 void setSeries(QXYSeries *series);
47
47
48 int xColumn() const;
48 int xColumn() const;
49 void setXColumn(int xColumn);
49 void setXColumn(int xColumn);
50
50
51 int yColumn() const;
51 int yColumn() const;
52 void setYColumn(int yColumn);
52 void setYColumn(int yColumn);
53
53
54 int firstRow() const;
54 int firstRow() const;
55 void setFirstRow(int firstRow);
55 void setFirstRow(int firstRow);
56
56
57 int rowCount() const;
57 int rowCount() const;
58 void setRowCount(int rowCount);
58 void setRowCount(int rowCount);
59
59
60 Q_SIGNALS:
60 Q_SIGNALS:
61 void seriesReplaced();
61 void seriesReplaced();
62 void modelReplaced();
62 void modelReplaced();
63 void xColumnChanged();
63 void xColumnChanged();
64 void yColumnChanged();
64 void yColumnChanged();
65 void firstRowChanged();
65 void firstRowChanged();
66 void rowCountChanged();
66 void rowCountChanged();
67 };
67 };
68
68
69 QT_CHARTS_END_NAMESPACE
69 QT_CHARTS_END_NAMESPACE
70
70
71 #endif // QVXYMODELMAPPER_H
71 #endif // QVXYMODELMAPPER_H
@@ -1,72 +1,72
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QXYMODELMAPPER_H
22 #ifndef QXYMODELMAPPER_H
23 #define QXYMODELMAPPER_H
23 #define QXYMODELMAPPER_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCore/QObject>
26 #include <QtCore/QObject>
27
27
28 QT_BEGIN_NAMESPACE
28 QT_BEGIN_NAMESPACE
29 class QAbstractItemModel;
29 class QAbstractItemModel;
30 QT_END_NAMESPACE
30 QT_END_NAMESPACE
31
31
32 QT_CHARTS_BEGIN_NAMESPACE
32 QT_CHARTS_BEGIN_NAMESPACE
33
33
34 class QXYModelMapperPrivate;
34 class QXYModelMapperPrivate;
35 class QXYSeries;
35 class QXYSeries;
36
36
37 class QT_CHARTS_EXPORT QXYModelMapper : public QObject
37 class QT_CHARTS_EXPORT QXYModelMapper : public QObject
38 {
38 {
39 Q_OBJECT
39 Q_OBJECT
40
40
41 protected:
41 protected:
42 explicit QXYModelMapper(QObject *parent = 0);
42 explicit QXYModelMapper(QObject *parent = Q_NULLPTR);
43
43
44 QAbstractItemModel *model() const;
44 QAbstractItemModel *model() const;
45 void setModel(QAbstractItemModel *model);
45 void setModel(QAbstractItemModel *model);
46
46
47 QXYSeries *series() const;
47 QXYSeries *series() const;
48 void setSeries(QXYSeries *series);
48 void setSeries(QXYSeries *series);
49
49
50 int first() const;
50 int first() const;
51 void setFirst(int first);
51 void setFirst(int first);
52
52
53 int count() const;
53 int count() const;
54 void setCount(int count);
54 void setCount(int count);
55
55
56 Qt::Orientation orientation() const;
56 Qt::Orientation orientation() const;
57 void setOrientation(Qt::Orientation orientation);
57 void setOrientation(Qt::Orientation orientation);
58
58
59 int xSection() const;
59 int xSection() const;
60 void setXSection(int xSection);
60 void setXSection(int xSection);
61
61
62 int ySection() const;
62 int ySection() const;
63 void setYSection(int ySection);
63 void setYSection(int ySection);
64
64
65 protected:
65 protected:
66 QXYModelMapperPrivate *const d_ptr;
66 QXYModelMapperPrivate *const d_ptr;
67 Q_DECLARE_PRIVATE(QXYModelMapper)
67 Q_DECLARE_PRIVATE(QXYModelMapper)
68 };
68 };
69
69
70 QT_CHARTS_END_NAMESPACE
70 QT_CHARTS_END_NAMESPACE
71
71
72 #endif // QXYMODELMAPPER_H
72 #endif // QXYMODELMAPPER_H
@@ -1,136 +1,136
1 /******************************************************************************
1 /******************************************************************************
2 **
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
4 ** Contact: http://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module.
6 ** This file is part of the Qt Charts module.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:COMM$
8 ** $QT_BEGIN_LICENSE:COMM$
9 **
9 **
10 ** Commercial License Usage
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
17 **
18 ** $QT_END_LICENSE$
18 ** $QT_END_LICENSE$
19 **
19 **
20 ******************************************************************************/
20 ******************************************************************************/
21
21
22 #ifndef QXYSERIES_H
22 #ifndef QXYSERIES_H
23 #define QXYSERIES_H
23 #define QXYSERIES_H
24
24
25 #include <QtCharts/QChartGlobal>
25 #include <QtCharts/QChartGlobal>
26 #include <QtCharts/QAbstractSeries>
26 #include <QtCharts/QAbstractSeries>
27 #include <QtGui/QPen>
27 #include <QtGui/QPen>
28 #include <QtGui/QBrush>
28 #include <QtGui/QBrush>
29
29
30 QT_BEGIN_NAMESPACE
30 QT_BEGIN_NAMESPACE
31 class QModelIndex;
31 class QModelIndex;
32 QT_END_NAMESPACE
32 QT_END_NAMESPACE
33
33
34 QT_CHARTS_BEGIN_NAMESPACE
34 QT_CHARTS_BEGIN_NAMESPACE
35
35
36 class QXYSeriesPrivate;
36 class QXYSeriesPrivate;
37 class QXYModelMapper;
37 class QXYModelMapper;
38
38
39 class QT_CHARTS_EXPORT QXYSeries : public QAbstractSeries
39 class QT_CHARTS_EXPORT QXYSeries : public QAbstractSeries
40 {
40 {
41 Q_OBJECT
41 Q_OBJECT
42 Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible)
42 Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible)
43 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
43 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
44 Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged)
44 Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged)
45 Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged)
45 Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged)
46 Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged)
46 Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged)
47 Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged)
47 Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged)
48 Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged)
48 Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged)
49
49
50 protected:
50 protected:
51 explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = 0);
51 explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = Q_NULLPTR);
52
52
53 public:
53 public:
54 ~QXYSeries();
54 ~QXYSeries();
55 void append(qreal x, qreal y);
55 void append(qreal x, qreal y);
56 void append(const QPointF &point);
56 void append(const QPointF &point);
57 void append(const QList<QPointF> &points);
57 void append(const QList<QPointF> &points);
58 void replace(qreal oldX, qreal oldY, qreal newX, qreal newY);
58 void replace(qreal oldX, qreal oldY, qreal newX, qreal newY);
59 void replace(const QPointF &oldPoint, const QPointF &newPoint);
59 void replace(const QPointF &oldPoint, const QPointF &newPoint);
60 void replace(int index, qreal newX, qreal newY);
60 void replace(int index, qreal newX, qreal newY);
61 void replace(int index, const QPointF &newPoint);
61 void replace(int index, const QPointF &newPoint);
62 void remove(qreal x, qreal y);
62 void remove(qreal x, qreal y);
63 void remove(const QPointF &point);
63 void remove(const QPointF &point);
64 void remove(int index);
64 void remove(int index);
65 void removePoints(int index, int count);
65 void removePoints(int index, int count);
66 void insert(int index, const QPointF &point);
66 void insert(int index, const QPointF &point);
67 void clear();
67 void clear();
68
68
69 int count() const;
69 int count() const;
70 QList<QPointF> points() const;
70 QList<QPointF> points() const;
71 QVector<QPointF> pointsVector() const;
71 QVector<QPointF> pointsVector() const;
72 const QPointF &at(int index) const;
72 const QPointF &at(int index) const;
73
73
74 QXYSeries &operator << (const QPointF &point);
74 QXYSeries &operator << (const QPointF &point);
75 QXYSeries &operator << (const QList<QPointF> &points);
75 QXYSeries &operator << (const QList<QPointF> &points);
76
76
77 virtual void setPen(const QPen &pen);
77 virtual void setPen(const QPen &pen);
78 QPen pen() const;
78 QPen pen() const;
79
79
80 virtual void setBrush(const QBrush &brush);
80 virtual void setBrush(const QBrush &brush);
81 QBrush brush() const;
81 QBrush brush() const;
82
82
83 virtual void setColor(const QColor &color);
83 virtual void setColor(const QColor &color);
84 virtual QColor color() const;
84 virtual QColor color() const;
85
85
86 void setPointsVisible(bool visible = true);
86 void setPointsVisible(bool visible = true);
87 bool pointsVisible() const;
87 bool pointsVisible() const;
88
88
89 void setPointLabelsFormat(const QString &format);
89 void setPointLabelsFormat(const QString &format);
90 QString pointLabelsFormat() const;
90 QString pointLabelsFormat() const;
91
91
92 void setPointLabelsVisible(bool visible = true);
92 void setPointLabelsVisible(bool visible = true);
93 bool pointLabelsVisible() const;
93 bool pointLabelsVisible() const;
94
94
95 void setPointLabelsFont(const QFont &font);
95 void setPointLabelsFont(const QFont &font);
96 QFont pointLabelsFont() const;
96 QFont pointLabelsFont() const;
97
97
98 void setPointLabelsColor(const QColor &color);
98 void setPointLabelsColor(const QColor &color);
99 QColor pointLabelsColor() const;
99 QColor pointLabelsColor() const;
100
100
101 void setPointLabelsClipping(bool enabled = true);
101 void setPointLabelsClipping(bool enabled = true);
102 bool pointLabelsClipping() const;
102 bool pointLabelsClipping() const;
103
103
104 void replace(QList<QPointF> points);
104 void replace(QList<QPointF> points);
105 void replace(QVector<QPointF> points);
105 void replace(QVector<QPointF> points);
106
106
107 Q_SIGNALS:
107 Q_SIGNALS:
108 void clicked(const QPointF &point);
108 void clicked(const QPointF &point);
109 void hovered(const QPointF &point, bool state);
109 void hovered(const QPointF &point, bool state);
110 void pressed(const QPointF &point);
110 void pressed(const QPointF &point);
111 void released(const QPointF &point);
111 void released(const QPointF &point);
112 void doubleClicked(const QPointF &point);
112 void doubleClicked(const QPointF &point);
113 void pointReplaced(int index);
113 void pointReplaced(int index);
114 void pointRemoved(int index);
114 void pointRemoved(int index);
115 void pointAdded(int index);
115 void pointAdded(int index);
116 void colorChanged(QColor color);
116 void colorChanged(QColor color);
117 void pointsReplaced();
117 void pointsReplaced();
118 void pointLabelsFormatChanged(const QString &format);
118 void pointLabelsFormatChanged(const QString &format);
119 void pointLabelsVisibilityChanged(bool visible);
119 void pointLabelsVisibilityChanged(bool visible);
120 void pointLabelsFontChanged(const QFont &font);
120 void pointLabelsFontChanged(const QFont &font);
121 void pointLabelsColorChanged(const QColor &color);
121 void pointLabelsColorChanged(const QColor &color);
122 void pointLabelsClippingChanged(bool clipping);
122 void pointLabelsClippingChanged(bool clipping);
123 void pointsRemoved(int index, int count);
123 void pointsRemoved(int index, int count);
124 void penChanged(const QPen &pen);
124 void penChanged(const QPen &pen);
125
125
126 private:
126 private:
127 Q_DECLARE_PRIVATE(QXYSeries)
127 Q_DECLARE_PRIVATE(QXYSeries)
128 Q_DISABLE_COPY(QXYSeries)
128 Q_DISABLE_COPY(QXYSeries)
129 friend class QXYLegendMarkerPrivate;
129 friend class QXYLegendMarkerPrivate;
130 friend class XYLegendMarker;
130 friend class XYLegendMarker;
131 friend class XYChart;
131 friend class XYChart;
132 };
132 };
133
133
134 QT_CHARTS_END_NAMESPACE
134 QT_CHARTS_END_NAMESPACE
135
135
136 #endif // QXYSERIES_H
136 #endif // QXYSERIES_H
General Comments 0
You need to be logged in to leave comments. Login now