Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /**************************************************************************** |
---|---|
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 or (at your option) any later version |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
22 | ** included in the packaging of this file. Please review the following |
23 | ** information to ensure the GNU General Public License requirements will |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
25 | ** |
26 | ** $QT_END_LICENSE$ |
27 | ** |
28 | ****************************************************************************/ |
29 | |
30 | #ifndef QXYSERIES_H |
31 | #define QXYSERIES_H |
32 | |
33 | #include <QtCharts/QChartGlobal> |
34 | #include <QtCharts/QAbstractSeries> |
35 | #include <QtGui/QPen> |
36 | #include <QtGui/QBrush> |
37 | |
38 | QT_BEGIN_NAMESPACE |
39 | class QModelIndex; |
40 | QT_END_NAMESPACE |
41 | |
42 | QT_CHARTS_BEGIN_NAMESPACE |
43 | |
44 | class QXYSeriesPrivate; |
45 | class QXYModelMapper; |
46 | |
47 | class Q_CHARTS_EXPORT QXYSeries : public QAbstractSeries |
48 | { |
49 | Q_OBJECT |
50 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) |
51 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
52 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) |
53 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) |
54 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) |
55 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) |
56 | Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged) |
57 | |
58 | protected: |
59 | explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = nullptr); |
60 | |
61 | public: |
62 | ~QXYSeries(); |
63 | void append(qreal x, qreal y); |
64 | void append(const QPointF &point); |
65 | void append(const QList<QPointF> &points); |
66 | void replace(qreal oldX, qreal oldY, qreal newX, qreal newY); |
67 | void replace(const QPointF &oldPoint, const QPointF &newPoint); |
68 | void replace(int index, qreal newX, qreal newY); |
69 | void replace(int index, const QPointF &newPoint); |
70 | void remove(qreal x, qreal y); |
71 | void remove(const QPointF &point); |
72 | void remove(int index); |
73 | void removePoints(int index, int count); |
74 | void insert(int index, const QPointF &point); |
75 | void clear(); |
76 | |
77 | int count() const; |
78 | QList<QPointF> points() const; |
79 | QVector<QPointF> pointsVector() const; |
80 | const QPointF &at(int index) const; |
81 | |
82 | QXYSeries &operator << (const QPointF &point); |
83 | QXYSeries &operator << (const QList<QPointF> &points); |
84 | |
85 | virtual void setPen(const QPen &pen); |
86 | QPen pen() const; |
87 | |
88 | virtual void setBrush(const QBrush &brush); |
89 | QBrush brush() const; |
90 | |
91 | virtual void setColor(const QColor &color); |
92 | virtual QColor color() const; |
93 | |
94 | void setPointsVisible(bool visible = true); |
95 | bool pointsVisible() const; |
96 | |
97 | void setPointLabelsFormat(const QString &format); |
98 | QString pointLabelsFormat() const; |
99 | |
100 | void setPointLabelsVisible(bool visible = true); |
101 | bool pointLabelsVisible() const; |
102 | |
103 | void setPointLabelsFont(const QFont &font); |
104 | QFont pointLabelsFont() const; |
105 | |
106 | void setPointLabelsColor(const QColor &color); |
107 | QColor pointLabelsColor() const; |
108 | |
109 | void setPointLabelsClipping(bool enabled = true); |
110 | bool pointLabelsClipping() const; |
111 | |
112 | void replace(QList<QPointF> points); |
113 | void replace(QVector<QPointF> points); |
114 | |
115 | Q_SIGNALS: |
116 | void clicked(const QPointF &point); |
117 | void hovered(const QPointF &point, bool state); |
118 | void pressed(const QPointF &point); |
119 | void released(const QPointF &point); |
120 | void doubleClicked(const QPointF &point); |
121 | void pointReplaced(int index); |
122 | void pointRemoved(int index); |
123 | void pointAdded(int index); |
124 | void colorChanged(QColor color); |
125 | void pointsReplaced(); |
126 | void pointLabelsFormatChanged(const QString &format); |
127 | void pointLabelsVisibilityChanged(bool visible); |
128 | void pointLabelsFontChanged(const QFont &font); |
129 | void pointLabelsColorChanged(const QColor &color); |
130 | void pointLabelsClippingChanged(bool clipping); |
131 | void pointsRemoved(int index, int count); |
132 | void penChanged(const QPen &pen); |
133 | |
134 | private: |
135 | Q_DECLARE_PRIVATE(QXYSeries) |
136 | Q_DISABLE_COPY(QXYSeries) |
137 | friend class QXYLegendMarkerPrivate; |
138 | friend class XYLegendMarker; |
139 | friend class XYChart; |
140 | }; |
141 | |
142 | QT_CHARTS_END_NAMESPACE |
143 | |
144 | #endif // QXYSERIES_H |
145 |
Warning: That file was not part of the compilation database. It may have many parsing errors.