@@ -1,120 +1,119 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QCHART_H |
|
21 | #ifndef QCHART_H | |
22 | #define QCHART_H |
|
22 | #define QCHART_H | |
23 |
|
23 | |||
24 | #include <QSeries> |
|
24 | #include <QSeries> | |
25 | #include <QLegend> |
|
25 | #include <QLegend> | |
26 | #include <QGraphicsWidget> |
|
26 | #include <QGraphicsWidget> | |
27 |
|
27 | |||
28 | class QGraphicsSceneResizeEvent; |
|
28 | class QGraphicsSceneResizeEvent; | |
29 |
|
29 | |||
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | class QSeries; |
|
32 | class QSeries; | |
33 | class QChartAxis; |
|
33 | class QChartAxis; | |
34 | class QLegend; |
|
34 | class QLegend; | |
35 | struct QChartPrivate; |
|
35 | struct QChartPrivate; | |
36 |
|
36 | |||
37 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget |
|
37 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget | |
38 | { |
|
38 | { | |
39 | Q_OBJECT |
|
39 | Q_OBJECT | |
40 | Q_ENUMS(ChartTheme) |
|
40 | Q_ENUMS(ChartTheme) | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | enum ChartTheme { |
|
43 | enum ChartTheme { | |
44 | ChartThemeLight = 0, |
|
44 | ChartThemeLight = 0, | |
45 | ChartThemeBlueCerulean, |
|
45 | ChartThemeBlueCerulean, | |
46 | ChartThemeDark, |
|
46 | ChartThemeDark, | |
47 | ChartThemeBrownSand, |
|
47 | ChartThemeBrownSand, | |
48 | ChartThemeBlueNcs, |
|
48 | ChartThemeBlueNcs, | |
49 | ChartThemeHighContrast, |
|
49 | ChartThemeHighContrast, | |
50 |
ChartThemeBlueIcy |
|
50 | ChartThemeBlueIcy | |
51 | ChartThemeCount |
|
|||
52 | }; |
|
51 | }; | |
53 |
|
52 | |||
54 | enum AnimationOption { |
|
53 | enum AnimationOption { | |
55 | NoAnimation = 0x0, |
|
54 | NoAnimation = 0x0, | |
56 | GridAxisAnimations = 0x1, |
|
55 | GridAxisAnimations = 0x1, | |
57 | SeriesAnimations =0x2, |
|
56 | SeriesAnimations =0x2, | |
58 | AllAnimations = 0x3 |
|
57 | AllAnimations = 0x3 | |
59 | }; |
|
58 | }; | |
60 |
|
59 | |||
61 | Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) |
|
60 | Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) | |
62 |
|
61 | |||
63 | public: |
|
62 | public: | |
64 | explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); |
|
63 | explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); | |
65 | ~QChart(); |
|
64 | ~QChart(); | |
66 |
|
65 | |||
67 | void addSeries(QSeries *series, QChartAxis *axisY = 0); |
|
66 | void addSeries(QSeries *series, QChartAxis *axisY = 0); | |
68 | void removeSeries(QSeries *series); |
|
67 | void removeSeries(QSeries *series); | |
69 | void removeAllSeries(); |
|
68 | void removeAllSeries(); | |
70 |
|
69 | |||
71 | void setTheme(QChart::ChartTheme theme); |
|
70 | void setTheme(QChart::ChartTheme theme); | |
72 | QChart::ChartTheme theme() const; |
|
71 | QChart::ChartTheme theme() const; | |
73 |
|
72 | |||
74 | void setTitle(const QString& title); |
|
73 | void setTitle(const QString& title); | |
75 | QString title() const; |
|
74 | QString title() const; | |
76 | void setTitleFont(const QFont& font); |
|
75 | void setTitleFont(const QFont& font); | |
77 | QFont titleFont() const; |
|
76 | QFont titleFont() const; | |
78 | void setTitleBrush(const QBrush &brush); |
|
77 | void setTitleBrush(const QBrush &brush); | |
79 | QBrush titleBrush() const; |
|
78 | QBrush titleBrush() const; | |
80 |
|
79 | |||
81 | void setBackgroundBrush(const QBrush &brush); |
|
80 | void setBackgroundBrush(const QBrush &brush); | |
82 | QBrush backgroundBrush() const; |
|
81 | QBrush backgroundBrush() const; | |
83 | void setBackgroundPen(const QPen &pen); |
|
82 | void setBackgroundPen(const QPen &pen); | |
84 | QPen backgroundPen() const; |
|
83 | QPen backgroundPen() const; | |
85 |
|
84 | |||
86 | void setBackgroundVisible(bool visible); |
|
85 | void setBackgroundVisible(bool visible); | |
87 | bool isBackgroundVisible() const; |
|
86 | bool isBackgroundVisible() const; | |
88 |
|
87 | |||
89 | void setAnimationOptions(AnimationOptions options); |
|
88 | void setAnimationOptions(AnimationOptions options); | |
90 | AnimationOptions animationOptions() const; |
|
89 | AnimationOptions animationOptions() const; | |
91 |
|
90 | |||
92 | void zoomIn(); |
|
91 | void zoomIn(); | |
93 | void zoomIn(const QRectF &rect); |
|
92 | void zoomIn(const QRectF &rect); | |
94 | void zoomOut(); |
|
93 | void zoomOut(); | |
95 | void scrollLeft(); |
|
94 | void scrollLeft(); | |
96 | void scrollRight(); |
|
95 | void scrollRight(); | |
97 | void scrollUp(); |
|
96 | void scrollUp(); | |
98 | void scrollDown(); |
|
97 | void scrollDown(); | |
99 |
|
98 | |||
100 | QChartAxis* axisX() const; |
|
99 | QChartAxis* axisX() const; | |
101 | QChartAxis* axisY(QSeries* series = 0) const; |
|
100 | QChartAxis* axisY(QSeries* series = 0) const; | |
102 |
|
101 | |||
103 | QLegend* legend() const; |
|
102 | QLegend* legend() const; | |
104 | QRectF margins() const; |
|
103 | QRectF margins() const; | |
105 |
|
104 | |||
106 | protected: |
|
105 | protected: | |
107 | void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
106 | void resizeEvent(QGraphicsSceneResizeEvent *event); | |
108 |
|
107 | |||
109 | protected: |
|
108 | protected: | |
110 | QScopedPointer<QChartPrivate> d_ptr; |
|
109 | QScopedPointer<QChartPrivate> d_ptr; | |
111 | friend class QLegend; |
|
110 | friend class QLegend; | |
112 | friend class ChartPresenter; |
|
111 | friend class ChartPresenter; | |
113 | Q_DISABLE_COPY(QChart) |
|
112 | Q_DISABLE_COPY(QChart) | |
114 | }; |
|
113 | }; | |
115 |
|
114 | |||
116 | QTCOMMERCIALCHART_END_NAMESPACE |
|
115 | QTCOMMERCIALCHART_END_NAMESPACE | |
117 |
|
116 | |||
118 | Q_DECLARE_OPERATORS_FOR_FLAGS(QTCOMMERCIALCHART_NAMESPACE::QChart::AnimationOptions) |
|
117 | Q_DECLARE_OPERATORS_FOR_FLAGS(QTCOMMERCIALCHART_NAMESPACE::QChart::AnimationOptions) | |
119 |
|
118 | |||
120 | #endif |
|
119 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now