@@ -1,60 +1,60 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef AXISANIMATION_H |
|
29 | 29 | #define AXISANIMATION_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <QtCore/QPointF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class ChartAxisElement; |
|
37 | 37 | |
|
38 | 38 | class AxisAnimation: public ChartAnimation |
|
39 | 39 | { |
|
40 | 40 | public: |
|
41 | 41 | enum Animation { DefaultAnimation, ZoomOutAnimation, ZoomInAnimation, MoveForwardAnimation, MoveBackwordAnimation}; |
|
42 | 42 | AxisAnimation(ChartAxisElement *axis, int duration, QEasingCurve &curve); |
|
43 | 43 | ~AxisAnimation(); |
|
44 | 44 | void setAnimationType(Animation type); |
|
45 | 45 | void setAnimationPoint(const QPointF &point); |
|
46 | 46 | void setValues(QVector<qreal> &oldLayout, QVector<qreal> &newLayout); |
|
47 | 47 | protected: |
|
48 | 48 | QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; |
|
49 | 49 | void updateCurrentValue(const QVariant &value); |
|
50 | 50 | private: |
|
51 | 51 | ChartAxisElement *m_axis; |
|
52 | 52 | Animation m_type; |
|
53 | 53 | QPointF m_point; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | |
|
59 | 59 | |
|
60 | 60 | #endif /* AXISANIMATION_H */ |
@@ -1,57 +1,57 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BARANIMATION_P_H |
|
29 | 29 | #define BARANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class AbstractBarChartItem; |
|
36 | 36 | |
|
37 | 37 | class BarAnimation : public ChartAnimation |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | BarAnimation(AbstractBarChartItem *item, int duration, QEasingCurve &curve); |
|
43 | 43 | ~BarAnimation(); |
|
44 | 44 | |
|
45 | 45 | public: // from QVariantAnimation |
|
46 | 46 | virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; |
|
47 | 47 | virtual void updateCurrentValue(const QVariant &value); |
|
48 | 48 | |
|
49 | 49 | void setup(const QVector<QRectF> &oldLayout, const QVector<QRectF> &newLayout); |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | AbstractBarChartItem *m_item; |
|
53 | 53 | }; |
|
54 | 54 | |
|
55 | 55 | QT_CHARTS_END_NAMESPACE |
|
56 | 56 | |
|
57 | 57 | #endif // BARANIMATION_P_H |
@@ -1,64 +1,64 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BOXPLOTANIMATION_P_H |
|
29 | 29 | #define BOXPLOTANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <private/boxwhiskers_p.h> |
|
33 | 33 | #include <private/boxwhiskersdata_p.h> |
|
34 | 34 | #include <private/boxwhiskersanimation_p.h> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class BoxPlotChartItem; |
|
39 | 39 | |
|
40 | 40 | class BoxPlotAnimation : public QObject |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | public: |
|
44 | 44 | BoxPlotAnimation(BoxPlotChartItem *item, int duration, QEasingCurve &curve); |
|
45 | 45 | ~BoxPlotAnimation(); |
|
46 | 46 | |
|
47 | 47 | void addBox(BoxWhiskers *box); |
|
48 | 48 | ChartAnimation *boxAnimation(BoxWhiskers *box); |
|
49 | 49 | ChartAnimation *boxChangeAnimation(BoxWhiskers *box); |
|
50 | 50 | |
|
51 | 51 | void setAnimationStart(BoxWhiskers *box); |
|
52 | 52 | void stopAll(); |
|
53 | 53 | void removeBoxAnimation(BoxWhiskers *box); |
|
54 | 54 | |
|
55 | 55 | protected: |
|
56 | 56 | BoxPlotChartItem *m_item; |
|
57 | 57 | QHash<BoxWhiskers *, BoxWhiskersAnimation *> m_animations; |
|
58 | 58 | int m_animationDuration; |
|
59 | 59 | QEasingCurve m_animationCurve; |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | QT_CHARTS_END_NAMESPACE |
|
63 | 63 | |
|
64 | 64 | #endif // BOXPLOTANIMATION_P_H |
@@ -1,68 +1,68 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BOXWHISKERSANIMATION_P_H |
|
29 | 29 | #define BOXWHISKERSANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <private/boxwhiskers_p.h> |
|
33 | 33 | #include <private/boxwhiskersdata_p.h> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class BoxPlotChartItem; |
|
38 | 38 | class BoxPlotAnimation; |
|
39 | 39 | |
|
40 | 40 | class BoxWhiskersAnimation : public ChartAnimation |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | |
|
44 | 44 | public: |
|
45 | 45 | BoxWhiskersAnimation(BoxWhiskers *box, BoxPlotAnimation *boxPlotAnimation, int duration, |
|
46 | 46 | QEasingCurve &curve); |
|
47 | 47 | ~BoxWhiskersAnimation(); |
|
48 | 48 | |
|
49 | 49 | public: // from QVariantAnimation |
|
50 | 50 | virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; |
|
51 | 51 | virtual void updateCurrentValue(const QVariant &value); |
|
52 | 52 | |
|
53 | 53 | void setup(const BoxWhiskersData &startData, const BoxWhiskersData &endData); |
|
54 | 54 | void setEndData(const BoxWhiskersData &endData); |
|
55 | 55 | void setStartData(const BoxWhiskersData &endData); |
|
56 | 56 | |
|
57 | 57 | void moveMedianLine(bool move); |
|
58 | 58 | |
|
59 | 59 | protected: |
|
60 | 60 | friend class BoxPlotAnimation; |
|
61 | 61 | BoxWhiskers *m_box; |
|
62 | 62 | bool m_changeAnimation; |
|
63 | 63 | BoxPlotAnimation *m_boxPlotAnimation; |
|
64 | 64 | }; |
|
65 | 65 | |
|
66 | 66 | QT_CHARTS_END_NAMESPACE |
|
67 | 67 | |
|
68 | 68 | #endif // BOXWHISKERSANIMATION_P_H |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTANIMATION_H |
|
29 | 29 | #define CHARTANIMATION_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCore/QVariantAnimation> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | const static int ChartAnimationDuration = 1000; |
|
37 | 37 | |
|
38 | 38 | class ChartAnimation: public QVariantAnimation |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | ChartAnimation(QObject *parent = 0); |
|
43 | 43 | |
|
44 | 44 | void stopAndDestroyLater(); |
|
45 | 45 | |
|
46 | 46 | public Q_SLOTS: |
|
47 | 47 | void startChartAnimation(); |
|
48 | 48 | |
|
49 | 49 | protected: |
|
50 | 50 | bool m_destructing; |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif /* CHARTANIMATION_H */ |
@@ -1,62 +1,62 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef PIEANIMATION_P_H |
|
29 | 29 | #define PIEANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <private/piechartitem_p.h> |
|
33 | 33 | #include <private/piesliceanimation_p.h> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class PieChartItem; |
|
38 | 38 | |
|
39 | 39 | class PieAnimation : public ChartAnimation |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | |
|
43 | 43 | public: |
|
44 | 44 | PieAnimation(PieChartItem *item, int duration, QEasingCurve &curve); |
|
45 | 45 | ~PieAnimation(); |
|
46 | 46 | ChartAnimation *updateValue(PieSliceItem *sliceItem, const PieSliceData &newValue); |
|
47 | 47 | ChartAnimation *addSlice(PieSliceItem *sliceItem, const PieSliceData &endValue, bool startupAnimation); |
|
48 | 48 | ChartAnimation *removeSlice(PieSliceItem *sliceItem); |
|
49 | 49 | |
|
50 | 50 | public: // from QVariantAnimation |
|
51 | 51 | void updateCurrentValue(const QVariant &value); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | PieChartItem *m_item; |
|
55 | 55 | QHash<PieSliceItem *, PieSliceAnimation *> m_animations; |
|
56 | 56 | int m_animationDuration; |
|
57 | 57 | QEasingCurve m_animationCurve; |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | QT_CHARTS_END_NAMESPACE |
|
61 | 61 | |
|
62 | 62 | #endif |
@@ -1,58 +1,58 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef PIESLICEANIMATION_P_H |
|
29 | 29 | #define PIESLICEANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <private/piesliceitem_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class PieChartItem; |
|
37 | 37 | |
|
38 | 38 | class PieSliceAnimation : public ChartAnimation |
|
39 | 39 | { |
|
40 | 40 | public: |
|
41 | 41 | PieSliceAnimation(PieSliceItem *sliceItem); |
|
42 | 42 | ~PieSliceAnimation(); |
|
43 | 43 | void setValue(const PieSliceData &startValue, const PieSliceData &endValue); |
|
44 | 44 | void updateValue(const PieSliceData &endValue); |
|
45 | 45 | PieSliceData currentSliceValue(); |
|
46 | 46 | |
|
47 | 47 | protected: |
|
48 | 48 | QVariant interpolated(const QVariant &start, const QVariant &end, qreal progress) const; |
|
49 | 49 | void updateCurrentValue(const QVariant &value); |
|
50 | 50 | |
|
51 | 51 | private: |
|
52 | 52 | PieSliceItem *m_sliceItem; |
|
53 | 53 | PieSliceData m_currentValue; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | #endif |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef SCATTERANIMATION_P_H |
|
29 | 29 | #define SCATTERANIMATION_P_H |
|
30 | 30 | #include <private/xyanimation_p.h> |
|
31 | 31 | |
|
32 | 32 | QT_CHARTS_BEGIN_NAMESPACE |
|
33 | 33 | |
|
34 | 34 | class ScatterChartItem; |
|
35 | 35 | |
|
36 | 36 | class ScatterAnimation : public XYAnimation |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | ScatterAnimation(ScatterChartItem *item, int duration, QEasingCurve &curve); |
|
40 | 40 | ~ScatterAnimation(); |
|
41 | 41 | |
|
42 | 42 | protected: |
|
43 | 43 | void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif |
@@ -1,60 +1,60 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef SPLINEANIMATION_P_H |
|
29 | 29 | #define SPLINEANIMATION_P_H |
|
30 | 30 | #include <private/xyanimation_p.h> |
|
31 | 31 | #include <QtCore/QPointF> |
|
32 | 32 | |
|
33 | 33 | typedef QPair<QVector<QPointF >, QVector<QPointF > > SplineVector; |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class SplineChartItem; |
|
38 | 38 | |
|
39 | 39 | class SplineAnimation : public XYAnimation |
|
40 | 40 | { |
|
41 | 41 | public: |
|
42 | 42 | SplineAnimation(SplineChartItem *item, int duration, QEasingCurve &curve); |
|
43 | 43 | ~SplineAnimation(); |
|
44 | 44 | void setup(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, QVector<QPointF> &oldContorlPoints, QVector<QPointF> &newControlPoints, int index = -1); |
|
45 | 45 | |
|
46 | 46 | protected: |
|
47 | 47 | QVariant interpolated(const QVariant &start, const QVariant &end, qreal progress) const; |
|
48 | 48 | void updateCurrentValue(const QVariant &value); |
|
49 | 49 | void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); |
|
50 | 50 | |
|
51 | 51 | private: |
|
52 | 52 | SplineVector m_oldSpline; |
|
53 | 53 | SplineVector m_newSpline; |
|
54 | 54 | SplineChartItem *m_item; |
|
55 | 55 | bool m_valid; |
|
56 | 56 | }; |
|
57 | 57 | |
|
58 | 58 | QT_CHARTS_END_NAMESPACE |
|
59 | 59 | |
|
60 | 60 | #endif |
@@ -1,65 +1,65 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XYANIMATION_P_H |
|
29 | 29 | #define XYANIMATION_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartanimation_p.h> |
|
32 | 32 | #include <QtCore/QPointF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class XYChart; |
|
37 | 37 | |
|
38 | 38 | class XYAnimation : public ChartAnimation |
|
39 | 39 | { |
|
40 | 40 | protected: |
|
41 | 41 | enum Animation { AddPointAnimation, RemovePointAnimation, ReplacePointAnimation, NewAnimation }; |
|
42 | 42 | public: |
|
43 | 43 | XYAnimation(XYChart *item, int duration, QEasingCurve &curve); |
|
44 | 44 | ~XYAnimation(); |
|
45 | 45 | void setup(const QVector<QPointF> &oldPoints, const QVector<QPointF> &newPoints, int index = -1); |
|
46 | 46 | Animation animationType() const { return m_type; }; |
|
47 | 47 | |
|
48 | 48 | protected: |
|
49 | 49 | QVariant interpolated(const QVariant &start, const QVariant &end, qreal progress) const; |
|
50 | 50 | void updateCurrentValue(const QVariant &value); |
|
51 | 51 | void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); |
|
52 | 52 | XYChart *chartItem() { return m_item; } |
|
53 | 53 | protected: |
|
54 | 54 | Animation m_type; |
|
55 | 55 | bool m_dirty; |
|
56 | 56 | int m_index; |
|
57 | 57 | private: |
|
58 | 58 | XYChart *m_item; |
|
59 | 59 | QVector<QPointF> m_oldPoints; |
|
60 | 60 | QVector<QPointF> m_newPoints; |
|
61 | 61 | }; |
|
62 | 62 | |
|
63 | 63 | QT_CHARTS_END_NAMESPACE |
|
64 | 64 | |
|
65 | 65 | #endif |
@@ -1,132 +1,132 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef AREACHARTITEM_H |
|
29 | 29 | #define AREACHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/linechartitem_p.h> |
|
33 | 33 | #include <QtCharts/QAreaSeries> |
|
34 | 34 | #include <QtGui/QPen> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class AreaChartItem; |
|
39 | 39 | |
|
40 | 40 | class AreaChartItem : public ChartItem |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | public: |
|
44 | 44 | AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item = 0); |
|
45 | 45 | ~AreaChartItem(); |
|
46 | 46 | |
|
47 | 47 | //from QGraphicsItem |
|
48 | 48 | QRectF boundingRect() const; |
|
49 | 49 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
50 | 50 | QPainterPath shape() const; |
|
51 | 51 | |
|
52 | 52 | LineChartItem *upperLineItem() const { return m_upper; } |
|
53 | 53 | LineChartItem *lowerLineItem() const { return m_lower; } |
|
54 | 54 | |
|
55 | 55 | void updatePath(); |
|
56 | 56 | |
|
57 | 57 | void setPresenter(ChartPresenter *presenter); |
|
58 | 58 | QAreaSeries *series() const { return m_series; } |
|
59 | 59 | |
|
60 | 60 | protected: |
|
61 | 61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
62 | 62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
63 | 63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
64 | 64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
65 | 65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
66 | 66 | |
|
67 | 67 | Q_SIGNALS: |
|
68 | 68 | void clicked(const QPointF &point); |
|
69 | 69 | void hovered(const QPointF &point, bool state); |
|
70 | 70 | void pressed(const QPointF &point); |
|
71 | 71 | void released(const QPointF &point); |
|
72 | 72 | void doubleClicked(const QPointF &point); |
|
73 | 73 | |
|
74 | 74 | public Q_SLOTS: |
|
75 | 75 | void handleUpdated(); |
|
76 | 76 | void handleDomainUpdated(); |
|
77 | 77 | |
|
78 | 78 | private: |
|
79 | 79 | QAreaSeries *m_series; |
|
80 | 80 | LineChartItem *m_upper; |
|
81 | 81 | LineChartItem *m_lower; |
|
82 | 82 | QPainterPath m_path; |
|
83 | 83 | QRectF m_rect; |
|
84 | 84 | QPen m_linePen; |
|
85 | 85 | QPen m_pointPen; |
|
86 | 86 | QBrush m_brush; |
|
87 | 87 | bool m_pointsVisible; |
|
88 | 88 | |
|
89 | 89 | bool m_pointLabelsVisible; |
|
90 | 90 | QString m_pointLabelsFormat; |
|
91 | 91 | QFont m_pointLabelsFont; |
|
92 | 92 | QColor m_pointLabelsColor; |
|
93 | 93 | |
|
94 | 94 | QPointF m_lastMousePos; |
|
95 | 95 | bool m_mousePressed; |
|
96 | 96 | |
|
97 | 97 | }; |
|
98 | 98 | |
|
99 | 99 | class AreaBoundItem : public LineChartItem |
|
100 | 100 | { |
|
101 | 101 | public: |
|
102 | 102 | AreaBoundItem(AreaChartItem *area, QLineSeries *lineSeries,QGraphicsItem* item = 0) |
|
103 | 103 | : LineChartItem(lineSeries, item), m_item(area) |
|
104 | 104 | { |
|
105 | 105 | // We do not actually want to draw anything from LineChartItem. |
|
106 | 106 | // Drawing is done in AreaChartItem only. |
|
107 | 107 | setVisible(false); |
|
108 | 108 | } |
|
109 | 109 | ~AreaBoundItem() {} |
|
110 | 110 | |
|
111 | 111 | void updateGeometry() |
|
112 | 112 | { |
|
113 | 113 | // Make sure the series is in a chart before trying to update |
|
114 | 114 | if (m_item->series()->chart()) { |
|
115 | 115 | // Turn off points drawing from component line chart item, as that |
|
116 | 116 | // messes up the fill for area series. |
|
117 | 117 | suppressPoints(); |
|
118 | 118 | // Component lineseries are not necessarily themselves on the chart, |
|
119 | 119 | // so get the chart type for them from area chart. |
|
120 | 120 | forceChartType(m_item->series()->chart()->chartType()); |
|
121 | 121 | LineChartItem::updateGeometry(); |
|
122 | 122 | m_item->updatePath(); |
|
123 | 123 | } |
|
124 | 124 | } |
|
125 | 125 | |
|
126 | 126 | private: |
|
127 | 127 | AreaChartItem *m_item; |
|
128 | 128 | }; |
|
129 | 129 | |
|
130 | 130 | QT_CHARTS_END_NAMESPACE |
|
131 | 131 | |
|
132 | 132 | #endif |
@@ -1,76 +1,76 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QAREASERIES_P_H |
|
29 | 29 | #define QAREASERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractseries_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QAreaSeries; |
|
36 | 36 | class QLineSeries; |
|
37 | 37 | |
|
38 | 38 | class QAreaSeriesPrivate: public QAbstractSeriesPrivate |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q); |
|
44 | 44 | |
|
45 | 45 | void initializeDomain(); |
|
46 | 46 | void initializeAxes(); |
|
47 | 47 | void initializeGraphics(QGraphicsItem* parent); |
|
48 | 48 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
49 | 49 | void initializeAnimations(QChart::AnimationOptions options, int duration, |
|
50 | 50 | QEasingCurve &curve); |
|
51 | 51 | |
|
52 | 52 | QList<QLegendMarker *> createLegendMarkers(QLegend *legend); |
|
53 | 53 | |
|
54 | 54 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
55 | 55 | QAbstractAxis* createDefaultAxis(Qt::Orientation) const; |
|
56 | 56 | |
|
57 | 57 | Q_SIGNALS: |
|
58 | 58 | void updated(); |
|
59 | 59 | |
|
60 | 60 | protected: |
|
61 | 61 | QBrush m_brush; |
|
62 | 62 | QPen m_pen; |
|
63 | 63 | QLineSeries *m_upperSeries; |
|
64 | 64 | QLineSeries *m_lowerSeries; |
|
65 | 65 | bool m_pointsVisible; |
|
66 | 66 | QString m_pointLabelsFormat; |
|
67 | 67 | bool m_pointLabelsVisible; |
|
68 | 68 | QFont m_pointLabelsFont; |
|
69 | 69 | QColor m_pointLabelsColor; |
|
70 | 70 | private: |
|
71 | 71 | Q_DECLARE_PUBLIC(QAreaSeries); |
|
72 | 72 | }; |
|
73 | 73 | |
|
74 | 74 | QT_CHARTS_END_NAMESPACE |
|
75 | 75 | |
|
76 | 76 | #endif |
@@ -1,60 +1,60 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTBARCATEGORYAXISX_H |
|
29 | 29 | #define CHARTBARCATEGORYAXISX_H |
|
30 | 30 | |
|
31 | 31 | #include <private/horizontalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartPresenter; |
|
36 | 36 | class QBarCategoryAxis; |
|
37 | 37 | |
|
38 | 38 | class ChartBarCategoryAxisX : public HorizontalAxis |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | ChartBarCategoryAxisX(QBarCategoryAxis *axis, QGraphicsItem* item = 0); |
|
43 | 43 | ~ChartBarCategoryAxisX(); |
|
44 | 44 | |
|
45 | 45 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
46 | 46 | protected: |
|
47 | 47 | QVector<qreal> calculateLayout() const; |
|
48 | 48 | void updateGeometry(); |
|
49 | 49 | private: |
|
50 | 50 | QStringList createCategoryLabels(const QVector<qreal>& layout) const; |
|
51 | 51 | public Q_SLOTS: |
|
52 | 52 | void handleCategoriesChanged(); |
|
53 | 53 | |
|
54 | 54 | private: |
|
55 | 55 | QBarCategoryAxis *m_categoriesAxis; |
|
56 | 56 | }; |
|
57 | 57 | |
|
58 | 58 | QT_CHARTS_END_NAMESPACE |
|
59 | 59 | |
|
60 | 60 | #endif /* CHARTBARCATEGORYAXISX_H */ |
@@ -1,59 +1,59 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTBARCATEGORYAXISY_H |
|
29 | 29 | #define CHARTBARCATEGORYAXISY_H |
|
30 | 30 | |
|
31 | 31 | #include <private/verticalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QBarCategoryAxis; |
|
36 | 36 | class ChartPresenter; |
|
37 | 37 | |
|
38 | 38 | class ChartBarCategoryAxisY : public VerticalAxis |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | ChartBarCategoryAxisY(QBarCategoryAxis *axis, QGraphicsItem* item = 0); |
|
43 | 43 | ~ChartBarCategoryAxisY(); |
|
44 | 44 | |
|
45 | 45 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
46 | 46 | protected: |
|
47 | 47 | QVector<qreal> calculateLayout() const; |
|
48 | 48 | void updateGeometry(); |
|
49 | 49 | private: |
|
50 | 50 | QStringList createCategoryLabels(const QVector<qreal>& layout) const; |
|
51 | 51 | public Q_SLOTS: |
|
52 | 52 | void handleCategoriesChanged(); |
|
53 | 53 | private: |
|
54 | 54 | QBarCategoryAxis *m_categoriesAxis; |
|
55 | 55 | }; |
|
56 | 56 | |
|
57 | 57 | QT_CHARTS_END_NAMESPACE |
|
58 | 58 | |
|
59 | 59 | #endif /* CHARTBARCATEGORYAXISY_H */ |
@@ -1,79 +1,79 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBARCATEGORYAXIS_P_H |
|
29 | 29 | #define QBARCATEGORYAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QBarCategoryAxis> |
|
32 | 32 | #include <private/qabstractaxis_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class AbstractDomain; |
|
37 | 37 | |
|
38 | 38 | class QBarCategoryAxisPrivate : public QAbstractAxisPrivate |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | QBarCategoryAxisPrivate(QBarCategoryAxis *q); |
|
44 | 44 | ~QBarCategoryAxisPrivate(); |
|
45 | 45 | |
|
46 | 46 | public: |
|
47 | 47 | void initializeGraphics(QGraphicsItem* parent); |
|
48 | 48 | void initializeDomain(AbstractDomain *domain); |
|
49 | 49 | void updateCategoryDomain(); |
|
50 | 50 | |
|
51 | 51 | //interface for manipulating range form base class |
|
52 | 52 | void setRange(const QVariant &min, const QVariant &max); |
|
53 | 53 | void setMin(const QVariant &min); |
|
54 | 54 | void setMax(const QVariant &max); |
|
55 | 55 | |
|
56 | 56 | //interface manipulating range form domain |
|
57 | 57 | qreal min() { return m_min; } |
|
58 | 58 | qreal max() { return m_max; } |
|
59 | 59 | void setRange(qreal min,qreal max); |
|
60 | 60 | |
|
61 | 61 | private: |
|
62 | 62 | //range handling |
|
63 | 63 | void setRange(const QString &minCategory, const QString &maxCategory); |
|
64 | 64 | |
|
65 | 65 | private: |
|
66 | 66 | QStringList m_categories; |
|
67 | 67 | QString m_minCategory; |
|
68 | 68 | QString m_maxCategory; |
|
69 | 69 | qreal m_min; |
|
70 | 70 | qreal m_max; |
|
71 | 71 | int m_count; |
|
72 | 72 | |
|
73 | 73 | private: |
|
74 | 74 | Q_DECLARE_PUBLIC(QBarCategoryAxis); |
|
75 | 75 | }; |
|
76 | 76 | |
|
77 | 77 | QT_CHARTS_END_NAMESPACE |
|
78 | 78 | |
|
79 | 79 | #endif // QBARCATEGORYAXIS_P_H |
@@ -1,80 +1,80 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CARTESIANCHARTAXIS_H |
|
29 | 29 | #define CARTESIANCHARTAXIS_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/chartaxiselement_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QAbstractAxis; |
|
37 | 37 | |
|
38 | 38 | class CartesianChartAxis : public ChartAxisElement |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | Q_INTERFACES(QGraphicsLayoutItem) |
|
42 | 42 | public: |
|
43 | 43 | |
|
44 | 44 | CartesianChartAxis(QAbstractAxis *axis, QGraphicsItem *item = 0, bool intervalAxis = false); |
|
45 | 45 | ~CartesianChartAxis(); |
|
46 | 46 | |
|
47 | 47 | void setGeometry(const QRectF &axis, const QRectF &grid); |
|
48 | 48 | QRectF gridGeometry() const { return m_gridRect; } |
|
49 | 49 | bool isEmpty(); |
|
50 | 50 | |
|
51 | 51 | virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
52 | 52 | |
|
53 | 53 | protected: |
|
54 | 54 | void setGeometry(const QRectF &size) { Q_UNUSED(size);} |
|
55 | 55 | virtual void updateGeometry() = 0; |
|
56 | 56 | void updateLayout(QVector<qreal> &layout); |
|
57 | 57 | |
|
58 | 58 | public Q_SLOTS: |
|
59 | 59 | virtual void handleArrowPenChanged(const QPen &pen); |
|
60 | 60 | virtual void handleGridPenChanged(const QPen &pen); |
|
61 | 61 | virtual void handleShadesBrushChanged(const QBrush &brush); |
|
62 | 62 | virtual void handleShadesPenChanged(const QPen &pen); |
|
63 | 63 | virtual void handleMinorArrowPenChanged(const QPen &pen); |
|
64 | 64 | virtual void handleMinorGridPenChanged(const QPen &pen); |
|
65 | 65 | |
|
66 | 66 | private: |
|
67 | 67 | void createItems(int count); |
|
68 | 68 | void deleteItems(int count); |
|
69 | 69 | void updateMinorTickItems(); |
|
70 | 70 | |
|
71 | 71 | private: |
|
72 | 72 | QRectF m_gridRect; |
|
73 | 73 | |
|
74 | 74 | friend class AxisAnimation; |
|
75 | 75 | friend class LineArrowItem; |
|
76 | 76 | }; |
|
77 | 77 | |
|
78 | 78 | QT_CHARTS_END_NAMESPACE |
|
79 | 79 | |
|
80 | 80 | #endif /* CARTESIANCHARTAXIS_H */ |
@@ -1,59 +1,59 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTCATEGORYAXISX_H |
|
29 | 29 | #define CHARTCATEGORYAXISX_H |
|
30 | 30 | |
|
31 | 31 | #include <private/horizontalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QCategoryAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartCategoryAxisX : public HorizontalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartCategoryAxisX(QCategoryAxis *axis, QGraphicsItem* item = 0); |
|
42 | 42 | ~ChartCategoryAxisX(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | |
|
46 | 46 | public Q_SLOTS: |
|
47 | 47 | void handleCategoriesChanged(); |
|
48 | 48 | |
|
49 | 49 | protected: |
|
50 | 50 | QVector<qreal> calculateLayout() const; |
|
51 | 51 | void updateGeometry(); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QCategoryAxis *m_axis; |
|
55 | 55 | }; |
|
56 | 56 | |
|
57 | 57 | QT_CHARTS_END_NAMESPACE |
|
58 | 58 | |
|
59 | 59 | #endif /* CHARTCATEGORYAXISX_H */ |
@@ -1,59 +1,59 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTCATEGORYAXISY_H |
|
29 | 29 | #define CHARTCATEGORYAXISY_H |
|
30 | 30 | |
|
31 | 31 | #include <private/verticalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QCategoryAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartCategoryAxisY : public VerticalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartCategoryAxisY(QCategoryAxis *axis, QGraphicsItem* item = 0); |
|
42 | 42 | ~ChartCategoryAxisY(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | |
|
46 | 46 | public Q_SLOTS: |
|
47 | 47 | void handleCategoriesChanged(); |
|
48 | 48 | |
|
49 | 49 | protected: |
|
50 | 50 | QVector<qreal> calculateLayout() const; |
|
51 | 51 | void updateGeometry(); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QCategoryAxis *m_axis; |
|
55 | 55 | }; |
|
56 | 56 | |
|
57 | 57 | QT_CHARTS_END_NAMESPACE |
|
58 | 58 | |
|
59 | 59 | #endif /* CHARTCATEGORYAXISY_H */ |
@@ -1,54 +1,54 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTCATEGORYAXISANGULAR_P_H |
|
29 | 29 | #define POLARCHARTCATEGORYAXISANGULAR_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisangular_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QCategoryAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartCategoryAxisAngular : public PolarChartAxisAngular |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | PolarChartCategoryAxisAngular(QCategoryAxis *axis, QGraphicsItem *item); |
|
43 | 43 | ~PolarChartCategoryAxisAngular(); |
|
44 | 44 | |
|
45 | 45 | virtual QVector<qreal> calculateLayout() const; |
|
46 | 46 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
47 | 47 | |
|
48 | 48 | public Q_SLOTS: |
|
49 | 49 | void handleCategoriesChanged(); |
|
50 | 50 | }; |
|
51 | 51 | |
|
52 | 52 | QT_CHARTS_END_NAMESPACE |
|
53 | 53 | |
|
54 | 54 | #endif // POLARCHARTCATEGORYAXISANGULAR_P_H |
@@ -1,54 +1,54 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTCATEGORYAXISRADIAL_P_H |
|
29 | 29 | #define POLARCHARTCATEGORYAXISRADIAL_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisradial_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QCategoryAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartCategoryAxisRadial : public PolarChartAxisRadial |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | PolarChartCategoryAxisRadial(QCategoryAxis *axis, QGraphicsItem *item); |
|
43 | 43 | ~PolarChartCategoryAxisRadial(); |
|
44 | 44 | |
|
45 | 45 | virtual QVector<qreal> calculateLayout() const; |
|
46 | 46 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
47 | 47 | |
|
48 | 48 | public Q_SLOTS: |
|
49 | 49 | void handleCategoriesChanged(); |
|
50 | 50 | }; |
|
51 | 51 | |
|
52 | 52 | QT_CHARTS_END_NAMESPACE |
|
53 | 53 | |
|
54 | 54 | #endif // POLARCHARTCATEGORYAXISRADIAL_P_H |
@@ -1,61 +1,61 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QCATEGORYAXIS_P_H |
|
29 | 29 | #define QCATEGORYAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QCategoryAxis> |
|
32 | 32 | #include <private/qvalueaxis_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | typedef QPair<qreal, qreal> Range; |
|
37 | 37 | |
|
38 | 38 | class QCategoryAxisPrivate : public QValueAxisPrivate |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | QCategoryAxisPrivate(QCategoryAxis *q); |
|
44 | 44 | ~QCategoryAxisPrivate(); |
|
45 | 45 | |
|
46 | 46 | void initializeGraphics(QGraphicsItem* parent); |
|
47 | 47 | int ticksCount() const; |
|
48 | 48 | |
|
49 | 49 | private: |
|
50 | 50 | QMap<QString , Range> m_categoriesMap; |
|
51 | 51 | QStringList m_categories; |
|
52 | 52 | qreal m_categoryMinimum; |
|
53 | 53 | QCategoryAxis::AxisLabelsPosition m_labelsPosition; |
|
54 | 54 | |
|
55 | 55 | private: |
|
56 | 56 | Q_DECLARE_PUBLIC(QCategoryAxis) |
|
57 | 57 | }; |
|
58 | 58 | |
|
59 | 59 | QT_CHARTS_END_NAMESPACE |
|
60 | 60 | |
|
61 | 61 | #endif // QCATEGORYAXIS_P_H |
@@ -1,163 +1,163 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTAXISELEMENT_H |
|
29 | 29 | #define CHARTAXISELEMENT_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/chartelement_p.h> |
|
33 | 33 | #include <private/axisanimation_p.h> |
|
34 | 34 | #include <QtWidgets/QGraphicsItem> |
|
35 | 35 | #include <QtWidgets/QGraphicsLayoutItem> |
|
36 | 36 | #include <QtGui/QFont> |
|
37 | 37 | |
|
38 | 38 | QT_CHARTS_BEGIN_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | class ChartPresenter; |
|
41 | 41 | class QAbstractAxis; |
|
42 | 42 | |
|
43 | 43 | class ChartAxisElement : public ChartElement, public QGraphicsLayoutItem |
|
44 | 44 | { |
|
45 | 45 | Q_OBJECT |
|
46 | 46 | |
|
47 | 47 | using QGraphicsLayoutItem::setGeometry; |
|
48 | 48 | public: |
|
49 | 49 | ChartAxisElement(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis = false); |
|
50 | 50 | ~ChartAxisElement(); |
|
51 | 51 | |
|
52 | 52 | virtual QRectF gridGeometry() const = 0; |
|
53 | 53 | virtual void setGeometry(const QRectF &axis, const QRectF &grid) = 0; |
|
54 | 54 | virtual bool isEmpty() = 0; |
|
55 | 55 | |
|
56 | 56 | void setAnimation(AxisAnimation *animation) { m_animation = animation; } |
|
57 | 57 | AxisAnimation *animation() const { return m_animation; } |
|
58 | 58 | |
|
59 | 59 | QAbstractAxis *axis() const { return m_axis; } |
|
60 | 60 | void setLayout(QVector<qreal> &layout) { m_layout = layout; } |
|
61 | 61 | QVector<qreal> &layout() { return m_layout; } // Modifiable reference |
|
62 | 62 | inline qreal labelPadding() const { return qreal(4.0); } |
|
63 | 63 | inline qreal titlePadding() const { return qreal(2.0); } |
|
64 | 64 | void setLabels(const QStringList &labels) { m_labelsList = labels; } |
|
65 | 65 | QStringList labels() const { return m_labelsList; } |
|
66 | 66 | |
|
67 | 67 | qreal min() const; |
|
68 | 68 | qreal max() const; |
|
69 | 69 | |
|
70 | 70 | QRectF axisGeometry() const { return m_axisRect; } |
|
71 | 71 | void setAxisGeometry(const QRectF &axisGeometry) { m_axisRect = axisGeometry; } |
|
72 | 72 | |
|
73 | 73 | void axisSelected(); |
|
74 | 74 | |
|
75 | 75 | //this flag indicates that axis is used to show intervals it means labels are in between ticks |
|
76 | 76 | bool intervalAxis() const { return m_intervalAxis; } |
|
77 | 77 | |
|
78 | 78 | QStringList createValueLabels(qreal max, qreal min, int ticks, const QString &format) const; |
|
79 | 79 | QStringList createLogValueLabels(qreal min, qreal max, qreal base, int ticks, |
|
80 | 80 | const QString &format) const; |
|
81 | 81 | QStringList createDateTimeLabels(qreal max, qreal min, int ticks, const QString &format) const; |
|
82 | 82 | |
|
83 | 83 | // from QGraphicsLayoutItem |
|
84 | 84 | QRectF boundingRect() const |
|
85 | 85 | { |
|
86 | 86 | return QRectF(); |
|
87 | 87 | } |
|
88 | 88 | |
|
89 | 89 | // from QGraphicsLayoutItem |
|
90 | 90 | void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) |
|
91 | 91 | { |
|
92 | 92 | } |
|
93 | 93 | |
|
94 | 94 | protected: |
|
95 | 95 | virtual QVector<qreal> calculateLayout() const = 0; |
|
96 | 96 | virtual void updateLayout(QVector<qreal> &layout) = 0; |
|
97 | 97 | |
|
98 | 98 | QList<QGraphicsItem *> gridItems() { return m_grid->childItems(); } |
|
99 | 99 | QList<QGraphicsItem *> minorGridItems() { return m_minorGrid->childItems(); } |
|
100 | 100 | QList<QGraphicsItem *> labelItems() { return m_labels->childItems(); } |
|
101 | 101 | QList<QGraphicsItem *> shadeItems() { return m_shades->childItems(); } |
|
102 | 102 | QList<QGraphicsItem *> arrowItems() { return m_arrow->childItems(); } |
|
103 | 103 | QList<QGraphicsItem *> minorArrowItems() { return m_minorArrow->childItems(); } |
|
104 | 104 | QGraphicsTextItem *titleItem() const { return m_title.data(); } |
|
105 | 105 | QGraphicsItemGroup *gridGroup() { return m_grid.data(); } |
|
106 | 106 | QGraphicsItemGroup *minorGridGroup() { return m_minorGrid.data(); } |
|
107 | 107 | QGraphicsItemGroup *labelGroup() { return m_labels.data(); } |
|
108 | 108 | QGraphicsItemGroup *shadeGroup() { return m_shades.data(); } |
|
109 | 109 | QGraphicsItemGroup *arrowGroup() { return m_arrow.data(); } |
|
110 | 110 | QGraphicsItemGroup *minorArrowGroup() { return m_minorArrow.data(); } |
|
111 | 111 | |
|
112 | 112 | public Q_SLOTS: |
|
113 | 113 | void handleVisibleChanged(bool visible); |
|
114 | 114 | void handleArrowVisibleChanged(bool visible); |
|
115 | 115 | void handleGridVisibleChanged(bool visible); |
|
116 | 116 | void handleLabelsVisibleChanged(bool visible); |
|
117 | 117 | void handleShadesVisibleChanged(bool visible); |
|
118 | 118 | void handleLabelsAngleChanged(int angle); |
|
119 | 119 | virtual void handleShadesBrushChanged(const QBrush &brush) = 0; |
|
120 | 120 | virtual void handleShadesPenChanged(const QPen &pen) = 0; |
|
121 | 121 | virtual void handleArrowPenChanged(const QPen &pen) = 0; |
|
122 | 122 | virtual void handleGridPenChanged(const QPen &pen) = 0; |
|
123 | 123 | virtual void handleMinorArrowPenChanged(const QPen &pen) = 0; |
|
124 | 124 | virtual void handleMinorGridPenChanged(const QPen &pen) = 0; |
|
125 | 125 | void handleLabelsBrushChanged(const QBrush &brush); |
|
126 | 126 | void handleLabelsFontChanged(const QFont &font); |
|
127 | 127 | void handleTitleBrushChanged(const QBrush &brush); |
|
128 | 128 | void handleTitleFontChanged(const QFont &font); |
|
129 | 129 | void handleTitleTextChanged(const QString &title); |
|
130 | 130 | void handleTitleVisibleChanged(bool visible); |
|
131 | 131 | void handleRangeChanged(qreal min, qreal max); |
|
132 | 132 | void handleReverseChanged(bool reverse); |
|
133 | 133 | void handleMinorArrowVisibleChanged(bool visible); |
|
134 | 134 | void handleMinorGridVisibleChanged(bool visible); |
|
135 | 135 | void handleLabelsPositionChanged(); |
|
136 | 136 | |
|
137 | 137 | Q_SIGNALS: |
|
138 | 138 | void clicked(); |
|
139 | 139 | |
|
140 | 140 | private: |
|
141 | 141 | void connectSlots(); |
|
142 | 142 | QString formatLabel(const QString &formatSpec, const QByteArray &array, |
|
143 | 143 | qreal value, int precision, const QString &preStr, |
|
144 | 144 | const QString &postStr) const; |
|
145 | 145 | |
|
146 | 146 | QAbstractAxis *m_axis; |
|
147 | 147 | AxisAnimation *m_animation; |
|
148 | 148 | QVector<qreal> m_layout; |
|
149 | 149 | QStringList m_labelsList; |
|
150 | 150 | QRectF m_axisRect; |
|
151 | 151 | QScopedPointer<QGraphicsItemGroup> m_grid; |
|
152 | 152 | QScopedPointer<QGraphicsItemGroup> m_arrow; |
|
153 | 153 | QScopedPointer<QGraphicsItemGroup> m_minorGrid; |
|
154 | 154 | QScopedPointer<QGraphicsItemGroup> m_minorArrow; |
|
155 | 155 | QScopedPointer<QGraphicsItemGroup> m_shades; |
|
156 | 156 | QScopedPointer<QGraphicsItemGroup> m_labels; |
|
157 | 157 | QScopedPointer<QGraphicsTextItem> m_title; |
|
158 | 158 | bool m_intervalAxis; |
|
159 | 159 | }; |
|
160 | 160 | |
|
161 | 161 | QT_CHARTS_END_NAMESPACE |
|
162 | 162 | |
|
163 | 163 | #endif /* CHARTAXISELEMENT_H */ |
@@ -1,58 +1,58 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTDATETIMEAXISX_H |
|
29 | 29 | #define CHARTDATETIMEAXISX_H |
|
30 | 30 | |
|
31 | 31 | #include <private/horizontalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QDateTimeAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartDateTimeAxisX : public HorizontalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartDateTimeAxisX(QDateTimeAxis *axis, QGraphicsItem* item = 0); |
|
42 | 42 | ~ChartDateTimeAxisX(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | protected: |
|
46 | 46 | QVector<qreal> calculateLayout() const; |
|
47 | 47 | void updateGeometry(); |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleTickCountChanged(int tick); |
|
50 | 50 | void handleFormatChanged(const QString &format); |
|
51 | 51 | |
|
52 | 52 | private: |
|
53 | 53 | QDateTimeAxis *m_axis; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | #endif /* CHARTDATETIMEAXISX_H */ |
@@ -1,58 +1,58 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTDATETIMEAXISY_H |
|
29 | 29 | #define CHARTDATETIMEAXISY_H |
|
30 | 30 | |
|
31 | 31 | #include <private/verticalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QDateTimeAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartDateTimeAxisY : public VerticalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartDateTimeAxisY(QDateTimeAxis *axis, QGraphicsItem* item = 0); |
|
42 | 42 | ~ChartDateTimeAxisY(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | protected: |
|
46 | 46 | QVector<qreal> calculateLayout() const; |
|
47 | 47 | void updateGeometry(); |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleTickCountChanged(int tick); |
|
50 | 50 | void handleFormatChanged(const QString &format); |
|
51 | 51 | |
|
52 | 52 | private: |
|
53 | 53 | QDateTimeAxis *m_axis; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | #endif /* CHARTDATETIMEAXISY_H */ |
@@ -1,54 +1,54 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTDATETIMEAXISANGULAR_P_H |
|
29 | 29 | #define POLARCHARTDATETIMEAXISANGULAR_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisangular_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QDateTimeAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartDateTimeAxisAngular : public PolarChartAxisAngular |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | PolarChartDateTimeAxisAngular(QDateTimeAxis *axis, QGraphicsItem *item); |
|
42 | 42 | ~PolarChartDateTimeAxisAngular(); |
|
43 | 43 | |
|
44 | 44 | virtual QVector<qreal> calculateLayout() const; |
|
45 | 45 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
46 | 46 | |
|
47 | 47 | private Q_SLOTS: |
|
48 | 48 | void handleTickCountChanged(int tick); |
|
49 | 49 | void handleFormatChanged(const QString &format); |
|
50 | 50 | }; |
|
51 | 51 | |
|
52 | 52 | QT_CHARTS_END_NAMESPACE |
|
53 | 53 | |
|
54 | 54 | #endif // POLARCHARTDATETIMEAXISANGULAR_P_H |
@@ -1,54 +1,54 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTDATETIMEAXISRADIAL_P_H |
|
29 | 29 | #define POLARCHARTDATETIMEAXISRADIAL_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisradial_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QDateTimeAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartDateTimeAxisRadial : public PolarChartAxisRadial |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | PolarChartDateTimeAxisRadial(QDateTimeAxis *axis, QGraphicsItem *item); |
|
42 | 42 | ~PolarChartDateTimeAxisRadial(); |
|
43 | 43 | |
|
44 | 44 | virtual QVector<qreal> calculateLayout() const; |
|
45 | 45 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
46 | 46 | |
|
47 | 47 | private Q_SLOTS: |
|
48 | 48 | void handleTickCountChanged(int tick); |
|
49 | 49 | void handleFormatChanged(const QString &format); |
|
50 | 50 | }; |
|
51 | 51 | |
|
52 | 52 | QT_CHARTS_END_NAMESPACE |
|
53 | 53 | |
|
54 | 54 | #endif // POLARCHARTDATETIMEAXISRADIAL_P_H |
@@ -1,71 +1,71 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QDATETIMEAXIS_P_H |
|
29 | 29 | #define QDATETIMEAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QDateTimeAxis> |
|
32 | 32 | #include <private/qabstractaxis_p.h> |
|
33 | 33 | #include <QtCore/QDateTime> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class QDateTimeAxisPrivate : public QAbstractAxisPrivate |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | QDateTimeAxisPrivate(QDateTimeAxis *q); |
|
42 | 42 | ~QDateTimeAxisPrivate(); |
|
43 | 43 | |
|
44 | 44 | public: |
|
45 | 45 | void initializeGraphics(QGraphicsItem* parent); |
|
46 | 46 | void initializeDomain(AbstractDomain *domain); |
|
47 | 47 | |
|
48 | 48 | //interface for manipulating range form base class |
|
49 | 49 | void setMin(const QVariant &min); |
|
50 | 50 | void setMax(const QVariant &max); |
|
51 | 51 | void setRange(const QVariant &min, const QVariant &max); |
|
52 | 52 | |
|
53 | 53 | //interface manipulating range form domain |
|
54 | 54 | qreal min() { return m_min; } |
|
55 | 55 | qreal max() { return m_max; } |
|
56 | 56 | void setRange(qreal min,qreal max); |
|
57 | 57 | |
|
58 | 58 | protected: |
|
59 | 59 | int tickCount() const; |
|
60 | 60 | |
|
61 | 61 | protected: |
|
62 | 62 | qreal m_min; |
|
63 | 63 | qreal m_max; |
|
64 | 64 | int m_tickCount; |
|
65 | 65 | QString m_format; |
|
66 | 66 | Q_DECLARE_PUBLIC(QDateTimeAxis) |
|
67 | 67 | }; |
|
68 | 68 | |
|
69 | 69 | QT_CHARTS_END_NAMESPACE |
|
70 | 70 | |
|
71 | 71 | #endif // QDATETIMEAXIS_P_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef HORIZONTALAXIS_P_H_ |
|
29 | 29 | #define HORIZONTALAXIS_P_H_ |
|
30 | 30 | |
|
31 | 31 | #include <private/cartesianchartaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class HorizontalAxis : public CartesianChartAxis |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | HorizontalAxis(QAbstractAxis *axis, QGraphicsItem *item = 0, bool intervalAxis = false); |
|
39 | 39 | ~HorizontalAxis(); |
|
40 | 40 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
41 | 41 | protected: |
|
42 | 42 | void updateGeometry(); |
|
43 | 43 | |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif |
@@ -1,74 +1,74 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LINEARROWITEM_P_H |
|
29 | 29 | #define LINEARROWITEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartaxiselement_p.h> |
|
32 | 32 | #include <private/qabstractaxis_p.h> |
|
33 | 33 | #include <QtWidgets/QGraphicsLineItem> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class LineArrowItem: public QGraphicsLineItem |
|
38 | 38 | { |
|
39 | 39 | public: |
|
40 | 40 | explicit LineArrowItem(ChartAxisElement *axis, QGraphicsItem *parent = 0) |
|
41 | 41 | : QGraphicsLineItem(parent), |
|
42 | 42 | m_axis(axis), |
|
43 | 43 | m_axisOrientation(axis->axis()->orientation()) |
|
44 | 44 | { |
|
45 | 45 | } |
|
46 | 46 | |
|
47 | 47 | protected: |
|
48 | 48 | void mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
49 | 49 | { |
|
50 | 50 | Q_UNUSED(event) |
|
51 | 51 | m_axis->axisSelected(); |
|
52 | 52 | } |
|
53 | 53 | |
|
54 | 54 | QRectF boundingRect() const |
|
55 | 55 | { |
|
56 | 56 | return shape().boundingRect(); |
|
57 | 57 | } |
|
58 | 58 | |
|
59 | 59 | QPainterPath shape() const |
|
60 | 60 | { |
|
61 | 61 | QPainterPath path = QGraphicsLineItem::shape(); |
|
62 | 62 | QRectF rect = path.boundingRect(); |
|
63 | 63 | path.addRect(rect.adjusted(0, 0, m_axisOrientation != Qt::Horizontal ? 8 : 0, m_axisOrientation != Qt::Vertical ? 8 : 0)); |
|
64 | 64 | return path; |
|
65 | 65 | } |
|
66 | 66 | |
|
67 | 67 | private: |
|
68 | 68 | ChartAxisElement *m_axis; |
|
69 | 69 | Qt::Orientation m_axisOrientation; |
|
70 | 70 | }; |
|
71 | 71 | |
|
72 | 72 | QT_CHARTS_END_NAMESPACE |
|
73 | 73 | |
|
74 | 74 | #endif /* LINEARROWITEM_P_H */ |
@@ -1,61 +1,61 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTLOGVALUEAXISX_H |
|
29 | 29 | #define CHARTLOGVALUEAXISX_H |
|
30 | 30 | |
|
31 | 31 | #include <private/horizontalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QLogValueAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartLogValueAxisX : public HorizontalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | ChartLogValueAxisX(QLogValueAxis *axis, QGraphicsItem *item); |
|
43 | 43 | ~ChartLogValueAxisX(); |
|
44 | 44 | |
|
45 | 45 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
46 | 46 | |
|
47 | 47 | protected: |
|
48 | 48 | QVector<qreal> calculateLayout() const; |
|
49 | 49 | void updateGeometry(); |
|
50 | 50 | |
|
51 | 51 | private Q_SLOTS: |
|
52 | 52 | void handleBaseChanged(qreal base); |
|
53 | 53 | void handleLabelFormatChanged(const QString &format); |
|
54 | 54 | |
|
55 | 55 | private: |
|
56 | 56 | QLogValueAxis *m_axis; |
|
57 | 57 | }; |
|
58 | 58 | |
|
59 | 59 | QT_CHARTS_END_NAMESPACE |
|
60 | 60 | |
|
61 | 61 | #endif /* CHARTLOGVALUEAXISX_H */ |
@@ -1,61 +1,61 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTLOGVALUEAXISY_H |
|
29 | 29 | #define CHARTLOGVALUEAXISY_H |
|
30 | 30 | |
|
31 | 31 | #include <private/verticalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QLogValueAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartLogValueAxisY : public VerticalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | ChartLogValueAxisY(QLogValueAxis *axis, QGraphicsItem *item); |
|
43 | 43 | ~ChartLogValueAxisY(); |
|
44 | 44 | |
|
45 | 45 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
46 | 46 | |
|
47 | 47 | protected: |
|
48 | 48 | QVector<qreal> calculateLayout() const; |
|
49 | 49 | void updateGeometry(); |
|
50 | 50 | |
|
51 | 51 | private Q_SLOTS: |
|
52 | 52 | void handleBaseChanged(qreal base); |
|
53 | 53 | void handleLabelFormatChanged(const QString &format); |
|
54 | 54 | |
|
55 | 55 | private: |
|
56 | 56 | QLogValueAxis *m_axis; |
|
57 | 57 | }; |
|
58 | 58 | |
|
59 | 59 | QT_CHARTS_END_NAMESPACE |
|
60 | 60 | |
|
61 | 61 | #endif /* CHARTLOGVALUEAXISY_H */ |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTLOGVALUEAXISANGULAR_P_H |
|
29 | 29 | #define POLARCHARTLOGVALUEAXISANGULAR_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisangular_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QLogValueAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartLogValueAxisAngular : public PolarChartAxisAngular |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | PolarChartLogValueAxisAngular(QLogValueAxis *axis, QGraphicsItem *item); |
|
42 | 42 | ~PolarChartLogValueAxisAngular(); |
|
43 | 43 | |
|
44 | 44 | protected: |
|
45 | 45 | virtual QVector<qreal> calculateLayout() const; |
|
46 | 46 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
47 | 47 | |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleBaseChanged(qreal base); |
|
50 | 50 | void handleLabelFormatChanged(const QString &format); |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif // POLARCHARTLOGVALUEAXISANGULAR_P_H |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTLOGVALUEAXISRADIAL_P_H |
|
29 | 29 | #define POLARCHARTLOGVALUEAXISRADIAL_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisradial_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QLogValueAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartLogValueAxisRadial : public PolarChartAxisRadial |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | PolarChartLogValueAxisRadial(QLogValueAxis *axis, QGraphicsItem *item); |
|
42 | 42 | ~PolarChartLogValueAxisRadial(); |
|
43 | 43 | |
|
44 | 44 | protected: |
|
45 | 45 | virtual QVector<qreal> calculateLayout() const; |
|
46 | 46 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
47 | 47 | |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleBaseChanged(qreal base); |
|
50 | 50 | void handleLabelFormatChanged(const QString &format); |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif // POLARCHARTLOGVALUEAXISRADIAL_P_H |
@@ -1,67 +1,67 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QLOGVALUEAXIS_P_H |
|
29 | 29 | #define QLOGVALUEAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QLogValueAxis> |
|
32 | 32 | #include <private/qabstractaxis_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QLogValueAxisPrivate : public QAbstractAxisPrivate |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | QLogValueAxisPrivate(QLogValueAxis *q); |
|
41 | 41 | ~QLogValueAxisPrivate(); |
|
42 | 42 | |
|
43 | 43 | public: |
|
44 | 44 | void initializeGraphics(QGraphicsItem* parent); |
|
45 | 45 | void initializeDomain(AbstractDomain *domain); |
|
46 | 46 | |
|
47 | 47 | qreal min() { return m_min; } |
|
48 | 48 | qreal max() { return m_max; } |
|
49 | 49 | void setRange(qreal min,qreal max); |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | void setMin(const QVariant &min); |
|
53 | 53 | void setMax(const QVariant &max); |
|
54 | 54 | void setRange(const QVariant &min, const QVariant &max); |
|
55 | 55 | int tickCount() const; |
|
56 | 56 | |
|
57 | 57 | protected: |
|
58 | 58 | qreal m_min; |
|
59 | 59 | qreal m_max; |
|
60 | 60 | qreal m_base; |
|
61 | 61 | QString m_format; |
|
62 | 62 | Q_DECLARE_PUBLIC(QLogValueAxis) |
|
63 | 63 | }; |
|
64 | 64 | |
|
65 | 65 | QT_CHARTS_END_NAMESPACE |
|
66 | 66 | |
|
67 | 67 | #endif // QLOGVALUEAXIS_P_H |
@@ -1,69 +1,69 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTAXIS_P_H |
|
29 | 29 | #define POLARCHARTAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartaxiselement_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class PolarChartAxis : public ChartAxisElement |
|
36 | 36 | { |
|
37 | 37 | Q_OBJECT |
|
38 | 38 | Q_INTERFACES(QGraphicsLayoutItem) |
|
39 | 39 | public: |
|
40 | 40 | PolarChartAxis(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis = false); |
|
41 | 41 | ~PolarChartAxis(); |
|
42 | 42 | |
|
43 | 43 | void setGeometry(const QRectF &axis, const QRectF &grid); |
|
44 | 44 | virtual qreal preferredAxisRadius(const QSizeF &maxSize) = 0; |
|
45 | 45 | int tickWidth() { return 3; } |
|
46 | 46 | |
|
47 | 47 | public: // from ChartAxisElement |
|
48 | 48 | QRectF gridGeometry() const; |
|
49 | 49 | bool isEmpty(); |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | void updateLayout(QVector<qreal> &layout); |
|
53 | 53 | |
|
54 | 54 | protected: // virtual functions |
|
55 | 55 | virtual void createItems(int count) = 0; |
|
56 | 56 | virtual void createAxisLabels(const QVector<qreal> &layout) = 0; |
|
57 | 57 | virtual void updateMinorTickItems() = 0; |
|
58 | 58 | |
|
59 | 59 | public Q_SLOTS: |
|
60 | 60 | virtual void handleShadesBrushChanged(const QBrush &brush); |
|
61 | 61 | virtual void handleShadesPenChanged(const QPen &pen); |
|
62 | 62 | |
|
63 | 63 | private: |
|
64 | 64 | void deleteItems(int count); |
|
65 | 65 | }; |
|
66 | 66 | |
|
67 | 67 | QT_CHARTS_END_NAMESPACE |
|
68 | 68 | |
|
69 | 69 | #endif // POLARCHARTAXIS_P_H |
@@ -1,64 +1,64 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTAXISANGULAR_P_H |
|
29 | 29 | #define POLARCHARTAXISANGULAR_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxis_p.h> |
|
32 | 32 | #include <QtCharts/QValueAxis> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class PolarChartAxisAngular : public PolarChartAxis |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | PolarChartAxisAngular(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis = false); |
|
41 | 41 | ~PolarChartAxisAngular(); |
|
42 | 42 | |
|
43 | 43 | Qt::Orientation orientation() const; |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
45 | 45 | |
|
46 | 46 | virtual void updateGeometry(); |
|
47 | 47 | virtual void createItems(int count); |
|
48 | 48 | virtual void updateMinorTickItems(); |
|
49 | 49 | |
|
50 | 50 | qreal preferredAxisRadius(const QSizeF &maxSize); |
|
51 | 51 | |
|
52 | 52 | public Q_SLOTS: |
|
53 | 53 | virtual void handleArrowPenChanged(const QPen &pen); |
|
54 | 54 | virtual void handleGridPenChanged(const QPen &pen); |
|
55 | 55 | virtual void handleMinorArrowPenChanged(const QPen &pen); |
|
56 | 56 | virtual void handleMinorGridPenChanged(const QPen &pen); |
|
57 | 57 | |
|
58 | 58 | private: |
|
59 | 59 | QRectF moveLabelToPosition(qreal angularCoordinate, QPointF labelPoint, QRectF labelRect) const; |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | QT_CHARTS_END_NAMESPACE |
|
63 | 63 | |
|
64 | 64 | #endif // POLARCHARTAXISANGULAR_P_H |
@@ -1,61 +1,61 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTAXISRADIAL_P_H |
|
29 | 29 | #define POLARCHARTAXISRADIAL_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxis_p.h> |
|
32 | 32 | #include <QtCharts/QValueAxis> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class PolarChartAxisRadial : public PolarChartAxis |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | PolarChartAxisRadial(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis = false); |
|
41 | 41 | ~PolarChartAxisRadial(); |
|
42 | 42 | |
|
43 | 43 | Qt::Orientation orientation() const; |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
45 | 45 | |
|
46 | 46 | virtual void updateGeometry(); |
|
47 | 47 | virtual void createItems(int count); |
|
48 | 48 | virtual void updateMinorTickItems(); |
|
49 | 49 | |
|
50 | 50 | qreal preferredAxisRadius(const QSizeF &maxSize); |
|
51 | 51 | |
|
52 | 52 | public Q_SLOTS: |
|
53 | 53 | virtual void handleArrowPenChanged(const QPen &pen); |
|
54 | 54 | virtual void handleGridPenChanged(const QPen &pen); |
|
55 | 55 | virtual void handleMinorArrowPenChanged(const QPen &pen); |
|
56 | 56 | virtual void handleMinorGridPenChanged(const QPen &pen); |
|
57 | 57 | }; |
|
58 | 58 | |
|
59 | 59 | QT_CHARTS_END_NAMESPACE |
|
60 | 60 | |
|
61 | 61 | #endif // POLARCHARTAXISRADIAL_P_H |
@@ -1,133 +1,133 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QABSTRACTAXIS_P_H |
|
29 | 29 | #define QABSTRACTAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QAbstractAxis> |
|
32 | 32 | #include <private/chartaxiselement_p.h> |
|
33 | 33 | #include <QtCharts/QChart> |
|
34 | 34 | #include <QtCore/QDebug> |
|
35 | 35 | |
|
36 | 36 | QT_BEGIN_NAMESPACE |
|
37 | 37 | class QGraphicsItem; |
|
38 | 38 | QT_END_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | QT_CHARTS_BEGIN_NAMESPACE |
|
41 | 41 | |
|
42 | 42 | class ChartPresenter; |
|
43 | 43 | class AbstractDomain; |
|
44 | 44 | class QChart; |
|
45 | 45 | class QAbstractSeries; |
|
46 | 46 | class ChartTheme; |
|
47 | 47 | class ChartElement; |
|
48 | 48 | |
|
49 | 49 | class QT_CHARTS_AUTOTEST_EXPORT QAbstractAxisPrivate : public QObject |
|
50 | 50 | { |
|
51 | 51 | Q_OBJECT |
|
52 | 52 | public: |
|
53 | 53 | QAbstractAxisPrivate(QAbstractAxis *q); |
|
54 | 54 | ~QAbstractAxisPrivate(); |
|
55 | 55 | |
|
56 | 56 | public: |
|
57 | 57 | Qt::Alignment alignment() const { return m_alignment; } |
|
58 | 58 | Qt::Orientation orientation() const { return m_orientation; } |
|
59 | 59 | void setAlignment( Qt::Alignment alignment); |
|
60 | 60 | |
|
61 | 61 | virtual void initializeDomain(AbstractDomain *domain) = 0; |
|
62 | 62 | virtual void initializeGraphics(QGraphicsItem *parent) = 0; |
|
63 | 63 | virtual void initializeTheme(ChartTheme* theme, bool forced = false); |
|
64 | 64 | virtual void initializeAnimations(QChart::AnimationOptions options, int duration, |
|
65 | 65 | QEasingCurve &curve); |
|
66 | 66 | |
|
67 | 67 | //interface for manipulating range form base class |
|
68 | 68 | virtual void setMin(const QVariant &min) = 0; |
|
69 | 69 | virtual void setMax(const QVariant &max) = 0; |
|
70 | 70 | virtual void setRange(const QVariant &min, const QVariant &max) = 0; |
|
71 | 71 | |
|
72 | 72 | //interface manipulating range form domain |
|
73 | 73 | virtual void setRange(qreal min, qreal max) = 0; |
|
74 | 74 | virtual qreal min() = 0; |
|
75 | 75 | virtual qreal max() = 0; |
|
76 | 76 | |
|
77 | 77 | ChartAxisElement *axisItem() { return m_item.data(); } |
|
78 | 78 | |
|
79 | 79 | public Q_SLOTS: |
|
80 | 80 | void handleRangeChanged(qreal min, qreal max); |
|
81 | 81 | |
|
82 | 82 | Q_SIGNALS: |
|
83 | 83 | void rangeChanged(qreal min, qreal max); |
|
84 | 84 | |
|
85 | 85 | protected: |
|
86 | 86 | QAbstractAxis *q_ptr; |
|
87 | 87 | QChart *m_chart; |
|
88 | 88 | QScopedPointer<ChartAxisElement> m_item; |
|
89 | 89 | |
|
90 | 90 | private: |
|
91 | 91 | QList<QAbstractSeries*> m_series; |
|
92 | 92 | |
|
93 | 93 | Qt::Alignment m_alignment; |
|
94 | 94 | Qt::Orientation m_orientation; |
|
95 | 95 | |
|
96 | 96 | bool m_visible; |
|
97 | 97 | |
|
98 | 98 | bool m_arrowVisible; |
|
99 | 99 | QPen m_axisPen; |
|
100 | 100 | QBrush m_axisBrush; |
|
101 | 101 | |
|
102 | 102 | bool m_gridLineVisible; |
|
103 | 103 | QPen m_gridLinePen; |
|
104 | 104 | bool m_minorGridLineVisible; |
|
105 | 105 | QPen m_minorGridLinePen; |
|
106 | 106 | |
|
107 | 107 | bool m_labelsVisible; |
|
108 | 108 | QBrush m_labelsBrush; |
|
109 | 109 | QFont m_labelsFont; |
|
110 | 110 | int m_labelsAngle; |
|
111 | 111 | |
|
112 | 112 | bool m_titleVisible; |
|
113 | 113 | QBrush m_titleBrush; |
|
114 | 114 | QFont m_titleFont; |
|
115 | 115 | QString m_title; |
|
116 | 116 | |
|
117 | 117 | bool m_shadesVisible; |
|
118 | 118 | QPen m_shadesPen; |
|
119 | 119 | QBrush m_shadesBrush; |
|
120 | 120 | qreal m_shadesOpacity; |
|
121 | 121 | |
|
122 | 122 | bool m_dirty; |
|
123 | 123 | |
|
124 | 124 | bool m_reverse; |
|
125 | 125 | |
|
126 | 126 | friend class QAbstractAxis; |
|
127 | 127 | friend class ChartDataSet; |
|
128 | 128 | friend class ChartPresenter; |
|
129 | 129 | }; |
|
130 | 130 | |
|
131 | 131 | QT_CHARTS_END_NAMESPACE |
|
132 | 132 | |
|
133 | 133 | #endif |
@@ -1,59 +1,59 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTVALUEAXISX_H |
|
29 | 29 | #define CHARTVALUEAXISX_H |
|
30 | 30 | |
|
31 | 31 | #include <private/horizontalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QValueAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartValueAxisX : public HorizontalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartValueAxisX(QValueAxis *axis, QGraphicsItem *item = 0); |
|
42 | 42 | ~ChartValueAxisX(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | protected: |
|
46 | 46 | QVector<qreal> calculateLayout() const; |
|
47 | 47 | void updateGeometry(); |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleTickCountChanged(int tick); |
|
50 | 50 | void handleMinorTickCountChanged(int tick); |
|
51 | 51 | void handleLabelFormatChanged(const QString &format); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QValueAxis *m_axis; |
|
55 | 55 | }; |
|
56 | 56 | |
|
57 | 57 | QT_CHARTS_END_NAMESPACE |
|
58 | 58 | |
|
59 | 59 | #endif /* CHARTVALUEAXISX_H */ |
@@ -1,59 +1,59 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTVALUEAXISY_H |
|
29 | 29 | #define CHARTVALUEAXISY_H |
|
30 | 30 | |
|
31 | 31 | #include <private/verticalaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QValueAxis; |
|
36 | 36 | |
|
37 | 37 | class ChartValueAxisY : public VerticalAxis |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | ChartValueAxisY(QValueAxis *axis, QGraphicsItem *item = 0); |
|
42 | 42 | ~ChartValueAxisY(); |
|
43 | 43 | |
|
44 | 44 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
45 | 45 | protected: |
|
46 | 46 | QVector<qreal> calculateLayout() const; |
|
47 | 47 | void updateGeometry(); |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleTickCountChanged(int tick); |
|
50 | 50 | void handleMinorTickCountChanged(int tick); |
|
51 | 51 | void handleLabelFormatChanged(const QString &format); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QValueAxis *m_axis; |
|
55 | 55 | }; |
|
56 | 56 | |
|
57 | 57 | QT_CHARTS_END_NAMESPACE |
|
58 | 58 | |
|
59 | 59 | #endif /* CHARTVALUEAXISY_H */ |
@@ -1,56 +1,56 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTVALUEAXISANGULAR_P_H |
|
29 | 29 | #define POLARCHARTVALUEAXISANGULAR_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisangular_p.h> |
|
32 | 32 | #include <QtCharts/QValueAxis> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QValueAxis; |
|
37 | 37 | |
|
38 | 38 | class PolarChartValueAxisAngular : public PolarChartAxisAngular |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | PolarChartValueAxisAngular(QValueAxis *axis, QGraphicsItem *item); |
|
43 | 43 | ~PolarChartValueAxisAngular(); |
|
44 | 44 | |
|
45 | 45 | virtual QVector<qreal> calculateLayout() const; |
|
46 | 46 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
47 | 47 | |
|
48 | 48 | private Q_SLOTS: |
|
49 | 49 | void handleTickCountChanged(int tick); |
|
50 | 50 | void handleMinorTickCountChanged(int tick); |
|
51 | 51 | void handleLabelFormatChanged(const QString &format); |
|
52 | 52 | }; |
|
53 | 53 | |
|
54 | 54 | QT_CHARTS_END_NAMESPACE |
|
55 | 55 | |
|
56 | 56 | #endif // POLARCHARTVALUEAXISANGULAR_P_H |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTVALUEAXISRADIAL_P_H |
|
29 | 29 | #define POLARCHARTVALUEAXISRADIAL_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/polarchartaxisradial_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QValueAxis; |
|
36 | 36 | |
|
37 | 37 | class PolarChartValueAxisRadial : public PolarChartAxisRadial |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | public: |
|
41 | 41 | PolarChartValueAxisRadial(QValueAxis *axis, QGraphicsItem *item); |
|
42 | 42 | ~PolarChartValueAxisRadial(); |
|
43 | 43 | |
|
44 | 44 | virtual QVector<qreal> calculateLayout() const; |
|
45 | 45 | virtual void createAxisLabels(const QVector<qreal> &layout); |
|
46 | 46 | |
|
47 | 47 | private Q_SLOTS: |
|
48 | 48 | void handleTickCountChanged(int tick); |
|
49 | 49 | void handleMinorTickCountChanged(int tick); |
|
50 | 50 | void handleLabelFormatChanged(const QString &format); |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif // POLARCHARTVALUEAXISRADIAL_P_H |
@@ -1,68 +1,68 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QVALUEAXIS_P_H |
|
29 | 29 | #define QVALUEAXIS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QValueAxis> |
|
32 | 32 | #include <private/qabstractaxis_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QValueAxisPrivate : public QAbstractAxisPrivate |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | QValueAxisPrivate(QValueAxis *q); |
|
41 | 41 | ~QValueAxisPrivate(); |
|
42 | 42 | |
|
43 | 43 | public: |
|
44 | 44 | void initializeGraphics(QGraphicsItem* parent); |
|
45 | 45 | void initializeDomain(AbstractDomain *domain); |
|
46 | 46 | |
|
47 | 47 | qreal min() { return m_min; } |
|
48 | 48 | qreal max() { return m_max; } |
|
49 | 49 | void setRange(qreal min,qreal max); |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | void setMin(const QVariant &min); |
|
53 | 53 | void setMax(const QVariant &max); |
|
54 | 54 | void setRange(const QVariant &min, const QVariant &max); |
|
55 | 55 | |
|
56 | 56 | private: |
|
57 | 57 | qreal m_min; |
|
58 | 58 | qreal m_max; |
|
59 | 59 | int m_tickCount; |
|
60 | 60 | int m_minorTickCount; |
|
61 | 61 | QString m_format; |
|
62 | 62 | bool m_applying; |
|
63 | 63 | Q_DECLARE_PUBLIC(QValueAxis) |
|
64 | 64 | }; |
|
65 | 65 | |
|
66 | 66 | QT_CHARTS_END_NAMESPACE |
|
67 | 67 | |
|
68 | 68 | #endif // QVALUEAXIS_P_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef VERTICALAXIS_P_H_ |
|
29 | 29 | #define VERTICALAXIS_P_H_ |
|
30 | 30 | |
|
31 | 31 | #include <private/cartesianchartaxis_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class VerticalAxis : public CartesianChartAxis |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | VerticalAxis(QAbstractAxis *axis, QGraphicsItem *item = 0, bool intervalAxis = false); |
|
39 | 39 | ~VerticalAxis(); |
|
40 | 40 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
41 | 41 | protected: |
|
42 | 42 | void updateGeometry(); |
|
43 | 43 | |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif /* VERTICALAXIS_P_H_ */ |
@@ -1,95 +1,95 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef ABSTRACTBARCHARTITEM_H |
|
30 | 30 | #define ABSTRACTBARCHARTITEM_H |
|
31 | 31 | |
|
32 | 32 | #include <private/chartitem_p.h> |
|
33 | 33 | #include <QtCharts/QAbstractBarSeries> |
|
34 | 34 | #include <QtGui/QPen> |
|
35 | 35 | #include <QtGui/QBrush> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class Bar; |
|
40 | 40 | class QAxisCategories; |
|
41 | 41 | class QChart; |
|
42 | 42 | class BarAnimation; |
|
43 | 43 | |
|
44 | 44 | class AbstractBarChartItem : public ChartItem |
|
45 | 45 | { |
|
46 | 46 | Q_OBJECT |
|
47 | 47 | public: |
|
48 | 48 | AbstractBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
49 | 49 | virtual ~AbstractBarChartItem(); |
|
50 | 50 | |
|
51 | 51 | public: |
|
52 | 52 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
53 | 53 | QRectF boundingRect() const; |
|
54 | 54 | |
|
55 | 55 | virtual QVector<QRectF> calculateLayout() = 0; |
|
56 | 56 | virtual void initializeLayout() = 0; |
|
57 | 57 | virtual void applyLayout(const QVector<QRectF> &layout); |
|
58 | 58 | virtual void setAnimation(BarAnimation *animation); |
|
59 | 59 | void setLayout(const QVector<QRectF> &layout); |
|
60 | 60 | void updateLayout(const QVector<QRectF> &layout); |
|
61 | 61 | QRectF geometry() const { return m_rect;} |
|
62 | 62 | |
|
63 | 63 | public Q_SLOTS: |
|
64 | 64 | void handleDomainUpdated(); |
|
65 | 65 | void handleLayoutChanged(); |
|
66 | 66 | void handleLabelsVisibleChanged(bool visible); |
|
67 | 67 | void handleDataStructureChanged(); // structure of of series has changed, recreate graphic items |
|
68 | 68 | void handleVisibleChanged(); |
|
69 | 69 | void handleOpacityChanged(); |
|
70 | 70 | virtual void handleUpdatedBars(); |
|
71 | 71 | void handleLabelsPositionChanged(); |
|
72 | 72 | virtual void positionLabels(); |
|
73 | 73 | |
|
74 | 74 | protected: |
|
75 | 75 | void positionLabelsVertical(); |
|
76 | 76 | |
|
77 | 77 | qreal m_domainMinX; |
|
78 | 78 | qreal m_domainMaxX; |
|
79 | 79 | qreal m_domainMinY; |
|
80 | 80 | qreal m_domainMaxY; |
|
81 | 81 | |
|
82 | 82 | QRectF m_rect; |
|
83 | 83 | QVector<QRectF> m_layout; |
|
84 | 84 | |
|
85 | 85 | BarAnimation *m_animation; |
|
86 | 86 | |
|
87 | 87 | QAbstractBarSeries *m_series; // Not owned. |
|
88 | 88 | QList<Bar *> m_bars; |
|
89 | 89 | QList<QGraphicsTextItem *> m_labels; |
|
90 | 90 | QSizeF m_oldSize; |
|
91 | 91 | }; |
|
92 | 92 | |
|
93 | 93 | QT_CHARTS_END_NAMESPACE |
|
94 | 94 | |
|
95 | 95 | #endif // ABSTRACTBARCHARTITEM_H |
@@ -1,72 +1,72 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BAR_H |
|
29 | 29 | #define BAR_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtWidgets/QGraphicsRectItem> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QBarSet; |
|
37 | 37 | |
|
38 | 38 | // Single visual bar item of chart |
|
39 | 39 | class Bar : public QObject, public QGraphicsRectItem |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | public: |
|
43 | 43 | Bar(QBarSet *barset, int index, QGraphicsItem *parent = 0); |
|
44 | 44 | ~Bar(); |
|
45 | 45 | |
|
46 | 46 | public: |
|
47 | 47 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
48 | 48 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
49 | 49 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
50 | 50 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
51 | 51 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
52 | 52 | |
|
53 | 53 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); |
|
54 | 54 | |
|
55 | 55 | Q_SIGNALS: |
|
56 | 56 | void clicked(int index, QBarSet *barset); |
|
57 | 57 | void hovered(bool status, int index, QBarSet *barset); |
|
58 | 58 | void pressed(int index, QBarSet *barset); |
|
59 | 59 | void released(int index, QBarSet *barset); |
|
60 | 60 | void doubleClicked(int index, QBarSet *barset); |
|
61 | 61 | |
|
62 | 62 | private: |
|
63 | 63 | int m_index; |
|
64 | 64 | QBarSet *m_barset; |
|
65 | 65 | bool m_hovering; |
|
66 | 66 | |
|
67 | 67 | bool m_mousePressed; |
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | QT_CHARTS_END_NAMESPACE |
|
71 | 71 | |
|
72 | 72 | #endif // BAR_H |
@@ -1,49 +1,49 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef HORIZONTALBARCHARTITEM_H |
|
29 | 29 | #define HORIZONTALBARCHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <private/abstractbarchartitem_p.h> |
|
32 | 32 | #include <QtWidgets/QGraphicsItem> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class HorizontalBarChartItem : public AbstractBarChartItem |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | HorizontalBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
41 | 41 | |
|
42 | 42 | private: |
|
43 | 43 | virtual QVector<QRectF> calculateLayout(); |
|
44 | 44 | void initializeLayout(); |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | QT_CHARTS_END_NAMESPACE |
|
48 | 48 | |
|
49 | 49 | #endif // HORIZONTALBARCHARTITEM_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QHORIZONTALBARSERIES_P_H |
|
29 | 29 | #define QHORIZONTALBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QHorizontalBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | QHorizontalBarSeriesPrivate(QHorizontalBarSeries *q); |
|
40 | 40 | void initializeGraphics(QGraphicsItem* parent); |
|
41 | 41 | void initializeDomain(); |
|
42 | 42 | private: |
|
43 | 43 | Q_DECLARE_PUBLIC(QHorizontalBarSeries) |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif // QHORIZONTALBARSERIES_P_H |
@@ -1,50 +1,50 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef HORIZONTALPERCENTBARCHARTITEM_P_H |
|
29 | 29 | #define HORIZONTALPERCENTBARCHARTITEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/abstractbarchartitem_p.h> |
|
32 | 32 | #include <QtWidgets/QGraphicsItem> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class HorizontalPercentBarChartItem : public AbstractBarChartItem |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | HorizontalPercentBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
41 | 41 | void handleUpdatedBars(); |
|
42 | 42 | |
|
43 | 43 | private: |
|
44 | 44 | virtual QVector<QRectF> calculateLayout(); |
|
45 | 45 | void initializeLayout(); |
|
46 | 46 | }; |
|
47 | 47 | |
|
48 | 48 | QT_CHARTS_END_NAMESPACE |
|
49 | 49 | |
|
50 | 50 | #endif // HORIZONTALPERCENTBARCHARTITEM_P_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QHORIZONTALPERCENTBARSERIES_P_H |
|
29 | 29 | #define QHORIZONTALPERCENTBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QHorizontalPercentBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | QHorizontalPercentBarSeriesPrivate(QHorizontalPercentBarSeries *q); |
|
40 | 40 | void initializeGraphics(QGraphicsItem* parent); |
|
41 | 41 | void initializeDomain(); |
|
42 | 42 | private: |
|
43 | 43 | Q_DECLARE_PUBLIC(QHorizontalPercentBarSeries) |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif // QHORIZONTALPERCENTBARSERIES_P_H |
@@ -1,49 +1,49 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef HORIZONTALSTACKEDBARCHARTITEM_P_H |
|
29 | 29 | #define HORIZONTALSTACKEDBARCHARTITEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/abstractbarchartitem_p.h> |
|
32 | 32 | #include <QtWidgets/QGraphicsItem> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class HorizontalStackedBarChartItem : public AbstractBarChartItem |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | HorizontalStackedBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
41 | 41 | |
|
42 | 42 | private: |
|
43 | 43 | virtual QVector<QRectF> calculateLayout(); |
|
44 | 44 | void initializeLayout(); |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | QT_CHARTS_END_NAMESPACE |
|
48 | 48 | |
|
49 | 49 | #endif // HORIZONTALSTACKEDBARCHARTITEM_P_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QHORIZONTALSTACKEDBARSERIES_P_H |
|
29 | 29 | #define QHORIZONTALSTACKEDBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QHorizontalStackedBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | QHorizontalStackedBarSeriesPrivate(QHorizontalStackedBarSeries *q); |
|
40 | 40 | void initializeGraphics(QGraphicsItem* parent); |
|
41 | 41 | void initializeDomain(); |
|
42 | 42 | private: |
|
43 | 43 | Q_DECLARE_PUBLIC(QHorizontalStackedBarSeries) |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif // QHORIZONTALSTACKEDBARSERIES_P_H |
@@ -1,122 +1,122 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QABSTRACTBARSERIES_P_H |
|
29 | 29 | #define QABSTRACTBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QAbstractBarSeries> |
|
32 | 32 | #include <private/qabstractseries_p.h> |
|
33 | 33 | #include <QtCore/QStringList> |
|
34 | 34 | #include <QtCharts/QAbstractSeries> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QBarModelMapper; |
|
39 | 39 | class QBarCategoryAxis; |
|
40 | 40 | class QLegendMarker; |
|
41 | 41 | |
|
42 | 42 | class QAbstractBarSeriesPrivate : public QAbstractSeriesPrivate |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | public: |
|
46 | 46 | QAbstractBarSeriesPrivate(QAbstractBarSeries *parent); |
|
47 | 47 | int categoryCount() const; |
|
48 | 48 | |
|
49 | 49 | void setBarWidth(qreal width); |
|
50 | 50 | qreal barWidth() const; |
|
51 | 51 | |
|
52 | 52 | void setVisible(bool visible); |
|
53 | 53 | void setLabelsVisible(bool visible); |
|
54 | 54 | |
|
55 | 55 | void initializeDomain(); |
|
56 | 56 | void initializeAxes(); |
|
57 | 57 | void initializeAnimations(QChart::AnimationOptions options, int duration, QEasingCurve &curve); |
|
58 | 58 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
59 | 59 | |
|
60 | 60 | QList<QLegendMarker*> createLegendMarkers(QLegend *legend); |
|
61 | 61 | |
|
62 | 62 | virtual QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
63 | 63 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const; |
|
64 | 64 | |
|
65 | 65 | bool append(QBarSet *set); |
|
66 | 66 | bool remove(QBarSet *set); |
|
67 | 67 | bool append(QList<QBarSet *> sets); |
|
68 | 68 | bool remove(QList<QBarSet *> sets); |
|
69 | 69 | bool insert(int index, QBarSet *set); |
|
70 | 70 | |
|
71 | 71 | QBarSet *barsetAt(int index); |
|
72 | 72 | qreal min(); |
|
73 | 73 | qreal max(); |
|
74 | 74 | qreal valueAt(int set, int category); |
|
75 | 75 | qreal percentageAt(int set, int category); |
|
76 | 76 | qreal categorySum(int category); |
|
77 | 77 | qreal absoluteCategorySum(int category); |
|
78 | 78 | qreal maxCategorySum(); |
|
79 | 79 | qreal minX(); |
|
80 | 80 | qreal maxX(); |
|
81 | 81 | qreal categoryTop(int category); |
|
82 | 82 | qreal categoryBottom(int category); |
|
83 | 83 | qreal top(); |
|
84 | 84 | qreal bottom(); |
|
85 | 85 | |
|
86 | 86 | bool blockBarUpdate(); |
|
87 | 87 | |
|
88 | 88 | qreal labelsAngle() const; |
|
89 | 89 | |
|
90 | 90 | Q_SIGNALS: |
|
91 | 91 | void clicked(int index, QBarSet *barset); |
|
92 | 92 | void pressed(int index, QBarSet *barset); |
|
93 | 93 | void released(int index, QBarSet *barset); |
|
94 | 94 | void doubleClicked(int index, QBarSet *barset); |
|
95 | 95 | void updatedBars(); |
|
96 | 96 | void updatedLayout(); |
|
97 | 97 | void restructuredBars(); |
|
98 | 98 | void labelsVisibleChanged(bool visible); |
|
99 | 99 | void visibleChanged(); |
|
100 | 100 | |
|
101 | 101 | private: |
|
102 | 102 | void populateCategories(QBarCategoryAxis *axis); |
|
103 | 103 | |
|
104 | 104 | protected: |
|
105 | 105 | QList<QBarSet *> m_barSets; |
|
106 | 106 | qreal m_barWidth; |
|
107 | 107 | bool m_labelsVisible; |
|
108 | 108 | bool m_visible; |
|
109 | 109 | bool m_blockBarUpdate; |
|
110 | 110 | QString m_labelsFormat; |
|
111 | 111 | QAbstractBarSeries::LabelsPosition m_labelsPosition; |
|
112 | 112 | qreal m_labelsAngle; |
|
113 | 113 | |
|
114 | 114 | private: |
|
115 | 115 | Q_DECLARE_PUBLIC(QAbstractBarSeries) |
|
116 | 116 | friend class HorizontalBarChartItem; |
|
117 | 117 | friend class BarChartItem; |
|
118 | 118 | }; |
|
119 | 119 | |
|
120 | 120 | QT_CHARTS_END_NAMESPACE |
|
121 | 121 | |
|
122 | 122 | #endif // QABSTRACTBARSERIES_P_H |
@@ -1,96 +1,96 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBARMODELMAPPER_P_H |
|
29 | 29 | #define QBARMODELMAPPER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCore/QObject> |
|
32 | 32 | #include <QtCharts/QBarModelMapper> |
|
33 | 33 | |
|
34 | 34 | QT_BEGIN_NAMESPACE |
|
35 | 35 | class QModelIndex; |
|
36 | 36 | QT_END_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | QT_CHARTS_BEGIN_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | class QBarSet; |
|
41 | 41 | |
|
42 | 42 | class QBarModelMapperPrivate : public QObject |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | public: |
|
46 | 46 | explicit QBarModelMapperPrivate(QBarModelMapper *q); |
|
47 | 47 | |
|
48 | 48 | public Q_SLOTS: |
|
49 | 49 | // for the model |
|
50 | 50 | void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); |
|
51 | 51 | void modelHeaderDataUpdated(Qt::Orientation orientation, int first, int last); |
|
52 | 52 | void modelRowsAdded(QModelIndex parent, int start, int end); |
|
53 | 53 | void modelRowsRemoved(QModelIndex parent, int start, int end); |
|
54 | 54 | void modelColumnsAdded(QModelIndex parent, int start, int end); |
|
55 | 55 | void modelColumnsRemoved(QModelIndex parent, int start, int end); |
|
56 | 56 | void handleModelDestroyed(); |
|
57 | 57 | |
|
58 | 58 | // for the series |
|
59 | 59 | void barSetsAdded(QList<QBarSet *> sets); |
|
60 | 60 | void barSetsRemoved(QList<QBarSet *> sets); |
|
61 | 61 | void valuesAdded(int index, int count); |
|
62 | 62 | void valuesRemoved(int index, int count); |
|
63 | 63 | void barLabelChanged(); |
|
64 | 64 | void barValueChanged(int index); |
|
65 | 65 | void handleSeriesDestroyed(); |
|
66 | 66 | |
|
67 | 67 | void initializeBarFromModel(); |
|
68 | 68 | |
|
69 | 69 | private: |
|
70 | 70 | QBarSet *barSet(QModelIndex index); |
|
71 | 71 | QModelIndex barModelIndex(int barSection, int posInBar); |
|
72 | 72 | void insertData(int start, int end); |
|
73 | 73 | void removeData(int start, int end); |
|
74 | 74 | void blockModelSignals(bool block = true); |
|
75 | 75 | void blockSeriesSignals(bool block = true); |
|
76 | 76 | |
|
77 | 77 | private: |
|
78 | 78 | QAbstractBarSeries *m_series; |
|
79 | 79 | QList<QBarSet *> m_barSets; |
|
80 | 80 | QAbstractItemModel *m_model; |
|
81 | 81 | int m_first; |
|
82 | 82 | int m_count; |
|
83 | 83 | Qt::Orientation m_orientation; |
|
84 | 84 | int m_firstBarSetSection; |
|
85 | 85 | int m_lastBarSetSection; |
|
86 | 86 | bool m_seriesSignalsBlock; |
|
87 | 87 | bool m_modelSignalsBlock; |
|
88 | 88 | |
|
89 | 89 | private: |
|
90 | 90 | QBarModelMapper *q_ptr; |
|
91 | 91 | Q_DECLARE_PUBLIC(QBarModelMapper) |
|
92 | 92 | }; |
|
93 | 93 | |
|
94 | 94 | QT_CHARTS_END_NAMESPACE |
|
95 | 95 | |
|
96 | 96 | #endif // QBARMODELMAPPER_P_H |
@@ -1,80 +1,80 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBARSET_P_H |
|
29 | 29 | #define QBARSET_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QBarSet> |
|
32 | 32 | #include <QtCore/QMap> |
|
33 | 33 | #include <QtGui/QPen> |
|
34 | 34 | #include <QtGui/QBrush> |
|
35 | 35 | #include <QtGui/QFont> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QBarSetPrivate : public QObject |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | |
|
43 | 43 | public: |
|
44 | 44 | QBarSetPrivate(const QString label, QBarSet *parent); |
|
45 | 45 | ~QBarSetPrivate(); |
|
46 | 46 | |
|
47 | 47 | void append(QPointF value); |
|
48 | 48 | void append(QList<QPointF> values); |
|
49 | 49 | void append(QList<qreal> values); |
|
50 | 50 | |
|
51 | 51 | void insert(const int index, const qreal value); |
|
52 | 52 | void insert(const int index, const QPointF value); |
|
53 | 53 | int remove(const int index, const int count); |
|
54 | 54 | |
|
55 | 55 | void replace(const int index, const qreal value); |
|
56 | 56 | void replace(const int index, const QPointF value); |
|
57 | 57 | |
|
58 | 58 | qreal pos(const int index); |
|
59 | 59 | qreal value(const int index); |
|
60 | 60 | |
|
61 | 61 | Q_SIGNALS: |
|
62 | 62 | void restructuredBars(); |
|
63 | 63 | void updatedBars(); |
|
64 | 64 | void updatedLayout(); |
|
65 | 65 | |
|
66 | 66 | public: |
|
67 | 67 | QBarSet * const q_ptr; |
|
68 | 68 | QString m_label; |
|
69 | 69 | QList<QPointF> m_values; |
|
70 | 70 | QPen m_pen; |
|
71 | 71 | QBrush m_brush; |
|
72 | 72 | QBrush m_labelBrush; |
|
73 | 73 | QFont m_labelFont; |
|
74 | 74 | |
|
75 | 75 | friend class QBarSet; |
|
76 | 76 | }; |
|
77 | 77 | |
|
78 | 78 | QT_CHARTS_END_NAMESPACE |
|
79 | 79 | |
|
80 | 80 | #endif // QBARSETPRIVATE_P_H |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef BARCHARTITEM_H |
|
30 | 30 | #define BARCHARTITEM_H |
|
31 | 31 | |
|
32 | 32 | #include <private/abstractbarchartitem_p.h> |
|
33 | 33 | #include <QtCharts/QStackedBarSeries> |
|
34 | 34 | #include <QtWidgets/QGraphicsItem> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class BarChartItem : public AbstractBarChartItem |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | BarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
43 | 43 | |
|
44 | 44 | private Q_SLOTS: |
|
45 | 45 | void handleLabelsPositionChanged(); |
|
46 | 46 | void positionLabels(); |
|
47 | 47 | |
|
48 | 48 | private: |
|
49 | 49 | virtual QVector<QRectF> calculateLayout(); |
|
50 | 50 | void initializeLayout(); |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif // BARCHARTITEM_H |
@@ -1,50 +1,50 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBARSERIES_P_H |
|
29 | 29 | #define QBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | class QBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
38 | 38 | { |
|
39 | 39 | public: |
|
40 | 40 | QBarSeriesPrivate(QBarSeries *q); |
|
41 | 41 | void initializeGraphics(QGraphicsItem* parent); |
|
42 | 42 | void initializeDomain(); |
|
43 | 43 | |
|
44 | 44 | private: |
|
45 | 45 | Q_DECLARE_PUBLIC(QBarSeries) |
|
46 | 46 | }; |
|
47 | 47 | |
|
48 | 48 | QT_CHARTS_END_NAMESPACE |
|
49 | 49 | |
|
50 | 50 | #endif // QBARSERIES_P_H |
@@ -1,57 +1,57 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef PERCENTBARCHARTITEM_H |
|
30 | 30 | #define PERCENTBARCHARTITEM_H |
|
31 | 31 | |
|
32 | 32 | #include <private/abstractbarchartitem_p.h> |
|
33 | 33 | #include <QtWidgets/QGraphicsItem> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class QAbstractBarSeries; |
|
38 | 38 | |
|
39 | 39 | class PercentBarChartItem : public AbstractBarChartItem |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | public: |
|
43 | 43 | PercentBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0); |
|
44 | 44 | void handleUpdatedBars(); |
|
45 | 45 | |
|
46 | 46 | private Q_SLOTS: |
|
47 | 47 | void handleLabelsPositionChanged(); |
|
48 | 48 | void positionLabels(); |
|
49 | 49 | |
|
50 | 50 | private: |
|
51 | 51 | virtual QVector<QRectF> calculateLayout(); |
|
52 | 52 | void initializeLayout(); |
|
53 | 53 | }; |
|
54 | 54 | |
|
55 | 55 | QT_CHARTS_END_NAMESPACE |
|
56 | 56 | |
|
57 | 57 | #endif // PERCENTBARCHARTITEM_H |
@@ -1,49 +1,49 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QPERCENTBARSERIES_P_H |
|
29 | 29 | #define QPERCENTBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | class QPercentBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
38 | 38 | { |
|
39 | 39 | public: |
|
40 | 40 | QPercentBarSeriesPrivate(QPercentBarSeries *q); |
|
41 | 41 | void initializeDomain(); |
|
42 | 42 | void initializeGraphics(QGraphicsItem* parent); |
|
43 | 43 | private: |
|
44 | 44 | Q_DECLARE_PUBLIC(QPercentBarSeries) |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | QT_CHARTS_END_NAMESPACE |
|
48 | 48 | |
|
49 | 49 | #endif |
@@ -1,49 +1,49 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QSTACKEDBARSERIES_P_H |
|
29 | 29 | #define QSTACKEDBARSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractbarseries_p.h> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | class QStackedBarSeriesPrivate: public QAbstractBarSeriesPrivate |
|
38 | 38 | { |
|
39 | 39 | public: |
|
40 | 40 | QStackedBarSeriesPrivate(QStackedBarSeries *q); |
|
41 | 41 | void initializeGraphics(QGraphicsItem* parent); |
|
42 | 42 | void initializeDomain(); |
|
43 | 43 | private: |
|
44 | 44 | Q_DECLARE_PUBLIC(QStackedBarSeries) |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | QT_CHARTS_END_NAMESPACE |
|
48 | 48 | |
|
49 | 49 | #endif |
@@ -1,56 +1,56 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef STACKEDBARCHARTITEM_H |
|
30 | 30 | #define STACKEDBARCHARTITEM_H |
|
31 | 31 | |
|
32 | 32 | #include <private/abstractbarchartitem_p.h> |
|
33 | 33 | #include <QtCharts/QStackedBarSeries> |
|
34 | 34 | #include <QtWidgets/QGraphicsItem> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class StackedBarChartItem : public AbstractBarChartItem |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | public: |
|
42 | 42 | StackedBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item =0); |
|
43 | 43 | |
|
44 | 44 | private Q_SLOTS: |
|
45 | 45 | void handleLabelsPositionChanged(); |
|
46 | 46 | void positionLabels(); |
|
47 | 47 | |
|
48 | 48 | private: |
|
49 | 49 | virtual QVector<QRectF> calculateLayout(); |
|
50 | 50 | void initializeLayout(); |
|
51 | 51 | |
|
52 | 52 | }; |
|
53 | 53 | |
|
54 | 54 | QT_CHARTS_END_NAMESPACE |
|
55 | 55 | |
|
56 | 56 | #endif // STACKEDBARCHARTITEM_H |
@@ -1,82 +1,82 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef BOXPLOTCHARTITEM_H |
|
30 | 30 | #define BOXPLOTCHARTITEM_H |
|
31 | 31 | |
|
32 | 32 | #include <private/boxwhiskers_p.h> |
|
33 | 33 | #include <QtCharts/QBoxPlotSeries> |
|
34 | 34 | #include <private/chartitem_p.h> |
|
35 | 35 | #include <private/boxplotanimation_p.h> |
|
36 | 36 | #include <QtCharts/QBoxSet> |
|
37 | 37 | #include <QtWidgets/QGraphicsItem> |
|
38 | 38 | |
|
39 | 39 | QT_CHARTS_BEGIN_NAMESPACE |
|
40 | 40 | |
|
41 | 41 | class BoxPlotSeriesPrivate; |
|
42 | 42 | |
|
43 | 43 | class BoxPlotChartItem : public ChartItem |
|
44 | 44 | { |
|
45 | 45 | Q_OBJECT |
|
46 | 46 | public: |
|
47 | 47 | BoxPlotChartItem(QBoxPlotSeries *series, QGraphicsItem *item = 0); |
|
48 | 48 | ~BoxPlotChartItem(); |
|
49 | 49 | |
|
50 | 50 | void setAnimation(BoxPlotAnimation *animation); |
|
51 | 51 | |
|
52 | 52 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
53 | 53 | QRectF boundingRect() const; |
|
54 | 54 | |
|
55 | 55 | public Q_SLOTS: |
|
56 | 56 | void handleDataStructureChanged(); |
|
57 | 57 | void handleDomainUpdated(); |
|
58 | 58 | void handleLayoutChanged(); |
|
59 | 59 | void handleUpdatedBars(); |
|
60 | 60 | void handleBoxsetRemove(QList<QBoxSet *> barSets); |
|
61 | 61 | |
|
62 | 62 | private: |
|
63 | 63 | virtual QVector<QRectF> calculateLayout(); |
|
64 | 64 | void initializeLayout(); |
|
65 | 65 | bool updateBoxGeometry(BoxWhiskers *box, int index); |
|
66 | 66 | |
|
67 | 67 | protected: |
|
68 | 68 | friend class QBoxPlotSeriesPrivate; |
|
69 | 69 | QBoxPlotSeries *m_series; // Not owned. |
|
70 | 70 | QList<BoxWhiskers *> m_boxes; |
|
71 | 71 | QHash<QBoxSet *, BoxWhiskers *> m_boxTable; |
|
72 | 72 | int m_seriesIndex; |
|
73 | 73 | int m_seriesCount; |
|
74 | 74 | |
|
75 | 75 | BoxPlotAnimation *m_animation; |
|
76 | 76 | |
|
77 | 77 | QRectF m_boundingRect; |
|
78 | 78 | }; |
|
79 | 79 | |
|
80 | 80 | QT_CHARTS_END_NAMESPACE |
|
81 | 81 | |
|
82 | 82 | #endif // BOXPLOTCHARTITEM_H |
@@ -1,107 +1,107 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BOXWHISKERS_H |
|
29 | 29 | #define BOXWHISKERS_H |
|
30 | 30 | |
|
31 | 31 | #include <private/boxwhiskersdata_p.h> |
|
32 | 32 | #include <QtCharts/QChartGlobal> |
|
33 | 33 | #include <private/abstractdomain_p.h> |
|
34 | 34 | #include <QtCharts/QBoxSet> |
|
35 | 35 | #include <QtWidgets/QGraphicsRectItem> |
|
36 | 36 | #include <QtWidgets/QGraphicsLineItem> |
|
37 | 37 | #include <QtWidgets/QGraphicsLayoutItem> |
|
38 | 38 | #include <QtGui/QPainterPath> |
|
39 | 39 | |
|
40 | 40 | QT_CHARTS_BEGIN_NAMESPACE |
|
41 | 41 | |
|
42 | 42 | class QBarSet; |
|
43 | 43 | |
|
44 | 44 | class BoxWhiskers : public QGraphicsObject |
|
45 | 45 | { |
|
46 | 46 | Q_OBJECT |
|
47 | 47 | |
|
48 | 48 | public: |
|
49 | 49 | BoxWhiskers(QBoxSet *set, AbstractDomain *domain, QGraphicsObject *parent); |
|
50 | 50 | ~BoxWhiskers(); |
|
51 | 51 | |
|
52 | 52 | void setBrush(const QBrush &brush); |
|
53 | 53 | void setPen(const QPen &pen); |
|
54 | 54 | void setLayout(const BoxWhiskersData &data); |
|
55 | 55 | void setBoxOutlined(const bool outlined) { m_boxOutlined = outlined; } |
|
56 | 56 | void setBoxWidth(const qreal width); |
|
57 | 57 | |
|
58 | 58 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
59 | 59 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
60 | 60 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
61 | 61 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
62 | 62 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
63 | 63 | |
|
64 | 64 | QRectF boundingRect() const; |
|
65 | 65 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); |
|
66 | 66 | |
|
67 | 67 | void updateGeometry(AbstractDomain *domain); |
|
68 | 68 | protected: |
|
69 | 69 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; |
|
70 | 70 | void setGeometry(const QRectF &rect); |
|
71 | 71 | |
|
72 | 72 | Q_SIGNALS: |
|
73 | 73 | void clicked(QBoxSet *boxset); |
|
74 | 74 | void hovered(bool status, QBoxSet *boxset); |
|
75 | 75 | void pressed(QBoxSet *boxset); |
|
76 | 76 | void released(QBoxSet *boxset); |
|
77 | 77 | void doubleClicked(QBoxSet *boxset); |
|
78 | 78 | |
|
79 | 79 | private: |
|
80 | 80 | friend class BoxPlotChartItem; |
|
81 | 81 | friend class BoxPlotAnimation; |
|
82 | 82 | |
|
83 | 83 | QBoxSet *m_boxSet; |
|
84 | 84 | AbstractDomain *m_domain; |
|
85 | 85 | QPainterPath m_boxPath; |
|
86 | 86 | QRectF m_boundingRect; |
|
87 | 87 | bool m_hovering; |
|
88 | 88 | bool m_validData; |
|
89 | 89 | QBrush m_brush; |
|
90 | 90 | QPen m_pen; |
|
91 | 91 | QPen m_medianPen; |
|
92 | 92 | QPen m_outlinePen; |
|
93 | 93 | bool m_boxOutlined; |
|
94 | 94 | qreal m_boxWidth; |
|
95 | 95 | BoxWhiskersData m_data; |
|
96 | 96 | QSizeF m_domainSize; |
|
97 | 97 | QRectF m_middleBox; |
|
98 | 98 | qreal m_geometryMedian; |
|
99 | 99 | qreal m_geometryLeft; |
|
100 | 100 | qreal m_geometryRight; |
|
101 | 101 | |
|
102 | 102 | bool m_mousePressed; |
|
103 | 103 | }; |
|
104 | 104 | |
|
105 | 105 | QT_CHARTS_END_NAMESPACE |
|
106 | 106 | |
|
107 | 107 | #endif // BOXWHISKERS_H |
@@ -1,78 +1,78 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef BOXWHISKERSDATA_P_H |
|
29 | 29 | #define BOXWHISKERSDATA_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class BoxWhiskersData |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | BoxWhiskersData() : |
|
40 | 40 | m_lowerExtreme(0.0), |
|
41 | 41 | m_lowerQuartile(0.0), |
|
42 | 42 | m_median(0.0), |
|
43 | 43 | m_upperQuartile(0.0), |
|
44 | 44 | m_upperExtreme(0.0), |
|
45 | 45 | m_index(0), |
|
46 | 46 | m_boxItems(0), |
|
47 | 47 | m_maxX(0.0), |
|
48 | 48 | m_minX(0.0), |
|
49 | 49 | m_maxY(0.0), |
|
50 | 50 | m_minY(0.0), |
|
51 | 51 | m_seriesIndex(0), |
|
52 | 52 | m_seriesCount(0) |
|
53 | 53 | { |
|
54 | 54 | } |
|
55 | 55 | |
|
56 | 56 | // Box related statistics |
|
57 | 57 | qreal m_lowerExtreme; |
|
58 | 58 | qreal m_lowerQuartile; |
|
59 | 59 | qreal m_median; |
|
60 | 60 | qreal m_upperQuartile; |
|
61 | 61 | qreal m_upperExtreme; |
|
62 | 62 | int m_index; |
|
63 | 63 | int m_boxItems; |
|
64 | 64 | |
|
65 | 65 | // Domain boundaries, axis |
|
66 | 66 | qreal m_maxX; |
|
67 | 67 | qreal m_minX; |
|
68 | 68 | qreal m_maxY; |
|
69 | 69 | qreal m_minY; |
|
70 | 70 | |
|
71 | 71 | // Serieses related data |
|
72 | 72 | int m_seriesIndex; |
|
73 | 73 | int m_seriesCount; |
|
74 | 74 | }; |
|
75 | 75 | |
|
76 | 76 | QT_CHARTS_END_NAMESPACE |
|
77 | 77 | |
|
78 | 78 | #endif // BOXWHISKERSDATA_P_H |
@@ -1,93 +1,93 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBOXPLOTMODELMAPPER_P_H |
|
29 | 29 | #define QBOXPLOTMODELMAPPER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCore/QObject> |
|
32 | 32 | #include <QtCharts/QBoxPlotModelMapper> |
|
33 | 33 | |
|
34 | 34 | QT_BEGIN_NAMESPACE |
|
35 | 35 | class QModelIndex; |
|
36 | 36 | QT_END_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | QT_CHARTS_BEGIN_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | class QBoxSet; |
|
41 | 41 | |
|
42 | 42 | class QBoxPlotModelMapperPrivate : public QObject |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | public: |
|
46 | 46 | explicit QBoxPlotModelMapperPrivate(QBoxPlotModelMapper *q); |
|
47 | 47 | |
|
48 | 48 | public Q_SLOTS: |
|
49 | 49 | // for the model |
|
50 | 50 | void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); |
|
51 | 51 | void modelHeaderDataUpdated(Qt::Orientation orientation, int first, int last); |
|
52 | 52 | void modelRowsAdded(QModelIndex parent, int start, int end); |
|
53 | 53 | void modelRowsRemoved(QModelIndex parent, int start, int end); |
|
54 | 54 | void modelColumnsAdded(QModelIndex parent, int start, int end); |
|
55 | 55 | void modelColumnsRemoved(QModelIndex parent, int start, int end); |
|
56 | 56 | void handleModelDestroyed(); |
|
57 | 57 | |
|
58 | 58 | // for the series |
|
59 | 59 | void boxSetsAdded(QList<QBoxSet *> sets); |
|
60 | 60 | void boxSetsRemoved(QList<QBoxSet *> sets); |
|
61 | 61 | void boxValueChanged(int index); |
|
62 | 62 | void handleSeriesDestroyed(); |
|
63 | 63 | |
|
64 | 64 | void initializeBoxFromModel(); |
|
65 | 65 | |
|
66 | 66 | private: |
|
67 | 67 | QBoxSet *boxSet(QModelIndex index); |
|
68 | 68 | QModelIndex boxModelIndex(int boxSection, int posInBox); |
|
69 | 69 | void insertData(int start, int end); |
|
70 | 70 | void removeData(int start, int end); |
|
71 | 71 | void blockModelSignals(bool block = true); |
|
72 | 72 | void blockSeriesSignals(bool block = true); |
|
73 | 73 | |
|
74 | 74 | private: |
|
75 | 75 | QBoxPlotSeries *m_series; |
|
76 | 76 | QList<QBoxSet *> m_boxSets; |
|
77 | 77 | QAbstractItemModel *m_model; |
|
78 | 78 | int m_first; |
|
79 | 79 | int m_count; |
|
80 | 80 | Qt::Orientation m_orientation; |
|
81 | 81 | int m_firstBoxSetSection; |
|
82 | 82 | int m_lastBoxSetSection; |
|
83 | 83 | bool m_seriesSignalsBlock; |
|
84 | 84 | bool m_modelSignalsBlock; |
|
85 | 85 | |
|
86 | 86 | private: |
|
87 | 87 | QBoxPlotModelMapper *q_ptr; |
|
88 | 88 | Q_DECLARE_PUBLIC(QBoxPlotModelMapper) |
|
89 | 89 | }; |
|
90 | 90 | |
|
91 | 91 | QT_CHARTS_END_NAMESPACE |
|
92 | 92 | |
|
93 | 93 | #endif // QBOXPLOTMODELMAPPER_P_H |
@@ -1,101 +1,101 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBOXPLOTSERIES_P_H |
|
29 | 29 | #define QBOXPLOTSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QBoxPlotSeries> |
|
32 | 32 | #include <private/qabstractbarseries_p.h> |
|
33 | 33 | #include <private/abstractdomain_p.h> |
|
34 | 34 | #include <QtCharts/QBarSet> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class BoxPlotAnimation; |
|
39 | 39 | |
|
40 | 40 | class QBoxPlotSeriesPrivate : public QAbstractSeriesPrivate |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | |
|
44 | 44 | public: |
|
45 | 45 | QBoxPlotSeriesPrivate(QBoxPlotSeries *q); |
|
46 | 46 | ~QBoxPlotSeriesPrivate(); |
|
47 | 47 | |
|
48 | 48 | void initializeGraphics(QGraphicsItem *parent); |
|
49 | 49 | void initializeDomain(); |
|
50 | 50 | void initializeAxes(); |
|
51 | 51 | void initializeAnimations(QChart::AnimationOptions options, int duration, QEasingCurve &curve); |
|
52 | 52 | void initializeTheme(int index, ChartTheme *theme, bool forced = false); |
|
53 | 53 | |
|
54 | 54 | QList<QLegendMarker*> createLegendMarkers(QLegend *legend); |
|
55 | 55 | |
|
56 | 56 | virtual QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
57 | 57 | QAbstractAxis *createDefaultAxis(Qt::Orientation orientation) const; |
|
58 | 58 | |
|
59 | 59 | bool append(QBoxSet *set); |
|
60 | 60 | bool remove(QBoxSet *set); |
|
61 | 61 | bool append(QList<QBoxSet *> sets); |
|
62 | 62 | bool remove(QList<QBoxSet *> sets); |
|
63 | 63 | bool insert(int index, QBoxSet *set); |
|
64 | 64 | QBoxSet *boxSetAt(int index); |
|
65 | 65 | |
|
66 | 66 | qreal max(); |
|
67 | 67 | qreal min(); |
|
68 | 68 | |
|
69 | 69 | private: |
|
70 | 70 | void populateCategories(QBarCategoryAxis *axis); |
|
71 | 71 | |
|
72 | 72 | Q_SIGNALS: |
|
73 | 73 | void updated(); |
|
74 | 74 | void clicked(int index, QBoxSet *barset); |
|
75 | 75 | void pressed(int index, QBoxSet *barset); |
|
76 | 76 | void released(int index, QBoxSet *barset); |
|
77 | 77 | void doubleClicked(int index, QBoxSet *barset); |
|
78 | 78 | void updatedBoxes(); |
|
79 | 79 | void updatedLayout(); |
|
80 | 80 | void restructuredBoxes(); |
|
81 | 81 | |
|
82 | 82 | private Q_SLOTS: |
|
83 | 83 | void handleSeriesChange(QAbstractSeries *series); |
|
84 | 84 | void handleSeriesRemove(QAbstractSeries *series); |
|
85 | 85 | |
|
86 | 86 | protected: |
|
87 | 87 | QList<QBoxSet *> m_boxSets; |
|
88 | 88 | QPen m_pen; |
|
89 | 89 | QBrush m_brush; |
|
90 | 90 | bool m_boxOutlineVisible; |
|
91 | 91 | int m_index; |
|
92 | 92 | BoxPlotAnimation *m_animation; |
|
93 | 93 | qreal m_boxWidth; |
|
94 | 94 | |
|
95 | 95 | private: |
|
96 | 96 | Q_DECLARE_PUBLIC(QBoxPlotSeries) |
|
97 | 97 | }; |
|
98 | 98 | |
|
99 | 99 | QT_CHARTS_END_NAMESPACE |
|
100 | 100 | |
|
101 | 101 | #endif |
@@ -1,82 +1,82 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBOXSET_P_H |
|
29 | 29 | #define QBOXSET_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QBoxSet> |
|
32 | 32 | #include <QtCore/QMap> |
|
33 | 33 | #include <QtGui/QPen> |
|
34 | 34 | #include <QtGui/QBrush> |
|
35 | 35 | #include <QtGui/QFont> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QBoxPlotSeriesPrivate; |
|
40 | 40 | |
|
41 | 41 | class QBoxSetPrivate : public QObject |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | |
|
45 | 45 | public: |
|
46 | 46 | QBoxSetPrivate(const QString label, QBoxSet *parent); |
|
47 | 47 | ~QBoxSetPrivate(); |
|
48 | 48 | |
|
49 | 49 | bool append(qreal value); |
|
50 | 50 | bool append(QList<qreal> values); |
|
51 | 51 | |
|
52 | 52 | int remove(const int index, const int count); |
|
53 | 53 | void clear(); |
|
54 | 54 | |
|
55 | 55 | void setValue(const int index, const qreal value); |
|
56 | 56 | |
|
57 | 57 | qreal value(const int index); |
|
58 | 58 | |
|
59 | 59 | Q_SIGNALS: |
|
60 | 60 | void restructuredBox(); |
|
61 | 61 | void updatedBox(); |
|
62 | 62 | void updatedLayout(); |
|
63 | 63 | |
|
64 | 64 | private: |
|
65 | 65 | const QBoxSet *q_ptr; |
|
66 | 66 | QString m_label; |
|
67 | 67 | const int m_valuesCount; |
|
68 | 68 | qreal *m_values; |
|
69 | 69 | int m_appendCount; |
|
70 | 70 | QPen m_pen; |
|
71 | 71 | QBrush m_brush; |
|
72 | 72 | QBrush m_labelBrush; |
|
73 | 73 | QFont m_labelFont; |
|
74 | 74 | QBoxPlotSeriesPrivate *m_series; |
|
75 | 75 | |
|
76 | 76 | friend class QBoxSet; |
|
77 | 77 | friend class QBoxPlotSeriesPrivate; |
|
78 | 78 | }; |
|
79 | 79 | |
|
80 | 80 | QT_CHARTS_END_NAMESPACE |
|
81 | 81 | |
|
82 | 82 | #endif // QBOXSET_P_H |
@@ -1,63 +1,63 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTBACKGROUND_H |
|
29 | 29 | #define CHARTBACKGROUND_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtWidgets/QGraphicsRectItem> |
|
33 | 33 | |
|
34 | 34 | QT_BEGIN_NAMESPACE |
|
35 | 35 | class QGraphicsDropShadowEffect; |
|
36 | 36 | QT_END_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | QT_CHARTS_BEGIN_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | class ChartBackground: public QGraphicsRectItem |
|
41 | 41 | { |
|
42 | 42 | public: |
|
43 | 43 | ChartBackground(QGraphicsItem *parent = 0); |
|
44 | 44 | ~ChartBackground(); |
|
45 | 45 | |
|
46 | 46 | void setDiameter(qreal diameter); |
|
47 | 47 | qreal diameter() const; |
|
48 | 48 | void setDropShadowEnabled(bool enabled); |
|
49 | 49 | bool isDropShadowEnabled() { return m_dropShadow != 0; } |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
53 | 53 | |
|
54 | 54 | private: |
|
55 | 55 | qreal m_diameter; |
|
56 | 56 | QGraphicsDropShadowEffect *m_dropShadow; |
|
57 | 57 | }; |
|
58 | 58 | |
|
59 | 59 | QT_CHARTS_END_NAMESPACE |
|
60 | 60 | |
|
61 | 61 | #endif /* CHARTBACKGROUND_H */ |
|
62 | 62 | |
|
63 | 63 |
@@ -1,58 +1,58 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTCONFIG_H |
|
29 | 29 | #define CHARTCONFIG_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartConfig |
|
36 | 36 | { |
|
37 | 37 | private: |
|
38 | 38 | ChartConfig() { |
|
39 | 39 | m_instance = this; |
|
40 | 40 | } |
|
41 | 41 | public: |
|
42 | 42 | static ChartConfig *instance() { |
|
43 | 43 | if (!m_instance) { |
|
44 | 44 | m_instance = new ChartConfig(); |
|
45 | 45 | } |
|
46 | 46 | return m_instance; |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | private: |
|
50 | 50 | static ChartConfig *m_instance; |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | |
|
54 | 54 | ChartConfig *ChartConfig::m_instance = 0; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | #endif |
@@ -1,92 +1,92 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTDATASET_P_H |
|
29 | 29 | #define CHARTDATASET_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QAbstractSeries> |
|
32 | 32 | #include <private/abstractdomain_p.h> |
|
33 | 33 | #include <private/qabstractaxis_p.h> |
|
34 | 34 | #include <QtCore/QVector> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QAbstractAxis; |
|
39 | 39 | class ChartPresenter; |
|
40 | 40 | |
|
41 | 41 | class QT_CHARTS_AUTOTEST_EXPORT ChartDataSet : public QObject |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | public: |
|
45 | 45 | ChartDataSet(QChart *chart); |
|
46 | 46 | virtual ~ChartDataSet(); |
|
47 | 47 | |
|
48 | 48 | void addSeries(QAbstractSeries *series); |
|
49 | 49 | void removeSeries(QAbstractSeries *series); |
|
50 | 50 | QList<QAbstractSeries *> series() const; |
|
51 | 51 | |
|
52 | 52 | void addAxis(QAbstractAxis *axis,Qt::Alignment aligment); |
|
53 | 53 | void removeAxis(QAbstractAxis *axis); |
|
54 | 54 | QList<QAbstractAxis*> axes() const; |
|
55 | 55 | |
|
56 | 56 | bool attachAxis(QAbstractSeries* series,QAbstractAxis *axis); |
|
57 | 57 | bool detachAxis(QAbstractSeries* series,QAbstractAxis *axis); |
|
58 | 58 | |
|
59 | 59 | void createDefaultAxes(); |
|
60 | 60 | |
|
61 | 61 | void zoomInDomain(const QRectF &rect); |
|
62 | 62 | void zoomOutDomain(const QRectF &rect); |
|
63 | 63 | void zoomResetDomain(); |
|
64 | 64 | bool isZoomedDomain(); |
|
65 | 65 | void scrollDomain(qreal dx, qreal dy); |
|
66 | 66 | |
|
67 | 67 | QPointF mapToValue(const QPointF &position, QAbstractSeries *series = 0); |
|
68 | 68 | QPointF mapToPosition(const QPointF &value, QAbstractSeries *series = 0); |
|
69 | 69 | |
|
70 | 70 | Q_SIGNALS: |
|
71 | 71 | void axisAdded(QAbstractAxis* axis); |
|
72 | 72 | void axisRemoved(QAbstractAxis* axis); |
|
73 | 73 | void seriesAdded(QAbstractSeries* series); |
|
74 | 74 | void seriesRemoved(QAbstractSeries* series); |
|
75 | 75 | |
|
76 | 76 | private: |
|
77 | 77 | void createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation orientation); |
|
78 | 78 | QAbstractAxis *createAxis(QAbstractAxis::AxisType type, Qt::Orientation orientation); |
|
79 | 79 | AbstractDomain::DomainType selectDomain(QList<QAbstractAxis* > axes); |
|
80 | 80 | AbstractDomain* createDomain(AbstractDomain::DomainType type); |
|
81 | 81 | void deleteAllAxes(); |
|
82 | 82 | void deleteAllSeries(); |
|
83 | 83 | void findMinMaxForSeries(QList<QAbstractSeries *> series,Qt::Orientations orientation, qreal &min, qreal &max); |
|
84 | 84 | private: |
|
85 | 85 | QList<QAbstractSeries *> m_seriesList; |
|
86 | 86 | QList<QAbstractAxis *> m_axisList; |
|
87 | 87 | QChart* m_chart; |
|
88 | 88 | }; |
|
89 | 89 | |
|
90 | 90 | QT_CHARTS_END_NAMESPACE |
|
91 | 91 | |
|
92 | 92 | #endif /* CHARTENGINE_P_H */ |
@@ -1,63 +1,63 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTELEMENT_H |
|
29 | 29 | #define CHARTELEMENT_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCore/QObject> |
|
33 | 33 | #include <QtCore/QRect> |
|
34 | 34 | #include <QGraphicsObject> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class ChartAnimator; |
|
39 | 39 | class ChartPresenter; |
|
40 | 40 | class ChartAnimation; |
|
41 | 41 | class ChartThemeManager; |
|
42 | 42 | class AbstractDomain; |
|
43 | 43 | |
|
44 | 44 | class ChartElement: public QGraphicsObject |
|
45 | 45 | { |
|
46 | 46 | |
|
47 | 47 | public: |
|
48 | 48 | explicit ChartElement(QGraphicsItem* item = 0); |
|
49 | 49 | |
|
50 | 50 | virtual ChartAnimation *animation() const { return 0; } |
|
51 | 51 | virtual void setPresenter(ChartPresenter *presenter); |
|
52 | 52 | ChartPresenter *presenter() const; |
|
53 | 53 | virtual void setThemeManager(ChartThemeManager *manager); |
|
54 | 54 | ChartThemeManager* themeManager() const; |
|
55 | 55 | |
|
56 | 56 | private: |
|
57 | 57 | ChartPresenter *m_presenter; |
|
58 | 58 | ChartThemeManager *m_themeManager; |
|
59 | 59 | }; |
|
60 | 60 | |
|
61 | 61 | QT_CHARTS_END_NAMESPACE |
|
62 | 62 | |
|
63 | 63 | #endif |
@@ -1,53 +1,53 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTHELPERS_P_H |
|
29 | 29 | #define CHARTHELPERS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCore/QtNumeric> |
|
32 | 32 | #include <QtCore/QPointF> |
|
33 | 33 | |
|
34 | 34 | static inline bool isValidValue(qreal value) |
|
35 | 35 | { |
|
36 | 36 | if (qIsNaN(value) || qIsInf(value)) { |
|
37 | 37 | qWarning("Ignored NaN, Inf, or -Inf value."); |
|
38 | 38 | return false; |
|
39 | 39 | } |
|
40 | 40 | return true; |
|
41 | 41 | } |
|
42 | 42 | |
|
43 | 43 | static inline bool isValidValue(qreal x, qreal y) |
|
44 | 44 | { |
|
45 | 45 | return (isValidValue(x) && isValidValue(y)); |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | static inline bool isValidValue(const QPointF point) |
|
49 | 49 | { |
|
50 | 50 | return (isValidValue(point.x()) && isValidValue(point.y())); |
|
51 | 51 | } |
|
52 | 52 | |
|
53 | 53 | #endif // CHARTHELPERS_P_H |
@@ -1,58 +1,58 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTITEM_H |
|
29 | 29 | #define CHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartelement_p.h> |
|
32 | 32 | #include <private/chartpresenter_p.h> |
|
33 | 33 | #include <QtWidgets/QGraphicsItem> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class ChartItem : public ChartElement |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | enum ChartItemTypes { AXIS_ITEM = UserType + 1, XYLINE_ITEM }; |
|
41 | 41 | public: |
|
42 | 42 | ChartItem(QAbstractSeriesPrivate *series,QGraphicsItem* item); |
|
43 | 43 | AbstractDomain* domain() const; |
|
44 | 44 | public Q_SLOTS: |
|
45 | 45 | virtual void handleDomainUpdated(); |
|
46 | 46 | |
|
47 | 47 | void reversePainter(QPainter *painter, const QRectF &clipRect); |
|
48 | 48 | QAbstractSeriesPrivate* seriesPrivate() const {return m_series;} |
|
49 | 49 | |
|
50 | 50 | protected: |
|
51 | 51 | bool m_validData; |
|
52 | 52 | private: |
|
53 | 53 | QAbstractSeriesPrivate* m_series; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | QT_CHARTS_END_NAMESPACE |
|
57 | 57 | |
|
58 | 58 | #endif /* CHARTITEM_H */ |
@@ -1,199 +1,199 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTPRESENTER_H |
|
29 | 29 | #define CHARTPRESENTER_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCharts/QChart> //because of QChart::ChartThemeId |
|
33 | 33 | #include <QtCore/QRectF> |
|
34 | 34 | #include <QtCore/QMargins> |
|
35 | 35 | #include <QtCore/QLocale> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class ChartItem; |
|
40 | 40 | class AxisItem; |
|
41 | 41 | class QAbstractSeries; |
|
42 | 42 | class ChartDataSet; |
|
43 | 43 | class AbstractDomain; |
|
44 | 44 | class ChartAxisElement; |
|
45 | 45 | class ChartAnimator; |
|
46 | 46 | class ChartBackground; |
|
47 | 47 | class ChartTitle; |
|
48 | 48 | class ChartAnimation; |
|
49 | 49 | class AbstractChartLayout; |
|
50 | 50 | |
|
51 | 51 | class ChartPresenter: public QObject |
|
52 | 52 | { |
|
53 | 53 | Q_OBJECT |
|
54 | 54 | public: |
|
55 | 55 | enum ZValues { |
|
56 | 56 | BackgroundZValue = -1, |
|
57 | 57 | PlotAreaZValue, |
|
58 | 58 | ShadesZValue, |
|
59 | 59 | GridZValue, |
|
60 | 60 | AxisZValue, |
|
61 | 61 | SeriesZValue, |
|
62 | 62 | LineChartZValue = SeriesZValue, |
|
63 | 63 | SplineChartZValue = SeriesZValue, |
|
64 | 64 | BarSeriesZValue = SeriesZValue, |
|
65 | 65 | ScatterSeriesZValue = SeriesZValue, |
|
66 | 66 | PieSeriesZValue = SeriesZValue, |
|
67 | 67 | BoxPlotSeriesZValue = SeriesZValue, |
|
68 | 68 | LegendZValue, |
|
69 | 69 | TopMostZValue |
|
70 | 70 | }; |
|
71 | 71 | |
|
72 | 72 | enum State { |
|
73 | 73 | ShowState, |
|
74 | 74 | ScrollUpState, |
|
75 | 75 | ScrollDownState, |
|
76 | 76 | ScrollLeftState, |
|
77 | 77 | ScrollRightState, |
|
78 | 78 | ZoomInState, |
|
79 | 79 | ZoomOutState |
|
80 | 80 | }; |
|
81 | 81 | |
|
82 | 82 | ChartPresenter(QChart *chart, QChart::ChartType type); |
|
83 | 83 | virtual ~ChartPresenter(); |
|
84 | 84 | |
|
85 | 85 | |
|
86 | 86 | void setGeometry(QRectF rect); |
|
87 | 87 | QRectF geometry() const; |
|
88 | 88 | |
|
89 | 89 | QGraphicsItem *rootItem(){ return m_chart; } |
|
90 | 90 | ChartBackground *backgroundElement(); |
|
91 | 91 | QAbstractGraphicsShapeItem *plotAreaElement(); |
|
92 | 92 | ChartTitle *titleElement(); |
|
93 | 93 | QList<ChartAxisElement *> axisItems() const; |
|
94 | 94 | QList<ChartItem *> chartItems() const; |
|
95 | 95 | |
|
96 | 96 | QLegend *legend(); |
|
97 | 97 | |
|
98 | 98 | void setBackgroundBrush(const QBrush &brush); |
|
99 | 99 | QBrush backgroundBrush() const; |
|
100 | 100 | |
|
101 | 101 | void setBackgroundPen(const QPen &pen); |
|
102 | 102 | QPen backgroundPen() const; |
|
103 | 103 | |
|
104 | 104 | void setBackgroundRoundness(qreal diameter); |
|
105 | 105 | qreal backgroundRoundness() const; |
|
106 | 106 | |
|
107 | 107 | void setPlotAreaBackgroundBrush(const QBrush &brush); |
|
108 | 108 | QBrush plotAreaBackgroundBrush() const; |
|
109 | 109 | |
|
110 | 110 | void setPlotAreaBackgroundPen(const QPen &pen); |
|
111 | 111 | QPen plotAreaBackgroundPen() const; |
|
112 | 112 | |
|
113 | 113 | void setTitle(const QString &title); |
|
114 | 114 | QString title() const; |
|
115 | 115 | |
|
116 | 116 | void setTitleFont(const QFont &font); |
|
117 | 117 | QFont titleFont() const; |
|
118 | 118 | |
|
119 | 119 | void setTitleBrush(const QBrush &brush); |
|
120 | 120 | QBrush titleBrush() const; |
|
121 | 121 | |
|
122 | 122 | void setBackgroundVisible(bool visible); |
|
123 | 123 | bool isBackgroundVisible() const; |
|
124 | 124 | |
|
125 | 125 | void setPlotAreaBackgroundVisible(bool visible); |
|
126 | 126 | bool isPlotAreaBackgroundVisible() const; |
|
127 | 127 | |
|
128 | 128 | void setBackgroundDropShadowEnabled(bool enabled); |
|
129 | 129 | bool isBackgroundDropShadowEnabled() const; |
|
130 | 130 | |
|
131 | 131 | void setLocalizeNumbers(bool localize); |
|
132 | 132 | inline bool localizeNumbers() const { return m_localizeNumbers; } |
|
133 | 133 | void setLocale(const QLocale &locale); |
|
134 | 134 | inline const QLocale &locale() const { return m_locale; } |
|
135 | 135 | |
|
136 | 136 | void setVisible(bool visible); |
|
137 | 137 | |
|
138 | 138 | void setAnimationOptions(QChart::AnimationOptions options); |
|
139 | 139 | QChart::AnimationOptions animationOptions() const; |
|
140 | 140 | void setAnimationDuration(int msecs); |
|
141 | 141 | int animationDuration() const { return m_animationDuration; } |
|
142 | 142 | void setAnimationEasingCurve(const QEasingCurve &curve); |
|
143 | 143 | QEasingCurve animationEasingCurve() const { return m_animationCurve; } |
|
144 | 144 | |
|
145 | 145 | void startAnimation(ChartAnimation *animation); |
|
146 | 146 | |
|
147 | 147 | void setState(State state,QPointF point); |
|
148 | 148 | State state() const { return m_state; } |
|
149 | 149 | QPointF statePoint() const { return m_statePoint; } |
|
150 | 150 | AbstractChartLayout *layout(); |
|
151 | 151 | |
|
152 | 152 | QChart::ChartType chartType() const { return m_chart->chartType(); } |
|
153 | 153 | QChart *chart() { return m_chart; } |
|
154 | 154 | |
|
155 | 155 | static QRectF textBoundingRect(const QFont &font, const QString &text, qreal angle = 0.0); |
|
156 | 156 | static QString truncatedText(const QFont &font, const QString &text, qreal angle, |
|
157 | 157 | qreal maxWidth, qreal maxHeight, QRectF &boundingRect); |
|
158 | 158 | inline static qreal textMargin() { return qreal(0.5); } |
|
159 | 159 | |
|
160 | 160 | QString numberToString(double value, char f = 'g', int prec = 6); |
|
161 | 161 | QString numberToString(int value); |
|
162 | 162 | |
|
163 | 163 | private: |
|
164 | 164 | void createBackgroundItem(); |
|
165 | 165 | void createPlotAreaBackgroundItem(); |
|
166 | 166 | void createTitleItem(); |
|
167 | 167 | |
|
168 | 168 | public Q_SLOTS: |
|
169 | 169 | void handleSeriesAdded(QAbstractSeries *series); |
|
170 | 170 | void handleSeriesRemoved(QAbstractSeries *series); |
|
171 | 171 | void handleAxisAdded(QAbstractAxis *axis); |
|
172 | 172 | void handleAxisRemoved(QAbstractAxis *axis); |
|
173 | 173 | |
|
174 | 174 | Q_SIGNALS: |
|
175 | 175 | void plotAreaChanged(const QRectF &plotArea); |
|
176 | 176 | |
|
177 | 177 | private: |
|
178 | 178 | QChart *m_chart; |
|
179 | 179 | QList<ChartItem *> m_chartItems; |
|
180 | 180 | QList<ChartAxisElement *> m_axisItems; |
|
181 | 181 | QList<QAbstractSeries *> m_series; |
|
182 | 182 | QList<QAbstractAxis *> m_axes; |
|
183 | 183 | QChart::AnimationOptions m_options; |
|
184 | 184 | int m_animationDuration; |
|
185 | 185 | QEasingCurve m_animationCurve; |
|
186 | 186 | State m_state; |
|
187 | 187 | QPointF m_statePoint; |
|
188 | 188 | AbstractChartLayout *m_layout; |
|
189 | 189 | ChartBackground *m_background; |
|
190 | 190 | QAbstractGraphicsShapeItem *m_plotAreaBackground; |
|
191 | 191 | ChartTitle *m_title; |
|
192 | 192 | QRectF m_rect; |
|
193 | 193 | bool m_localizeNumbers; |
|
194 | 194 | QLocale m_locale; |
|
195 | 195 | }; |
|
196 | 196 | |
|
197 | 197 | QT_CHARTS_END_NAMESPACE |
|
198 | 198 | |
|
199 | 199 | #endif /* CHARTPRESENTER_H */ |
@@ -1,82 +1,82 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEMANAGER_H |
|
29 | 29 | #define CHARTTHEMEMANAGER_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCharts/QChart> |
|
33 | 33 | #include <QtGui/QColor> |
|
34 | 34 | #include <QtGui/QGradientStops> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | class ChartTheme; |
|
38 | 38 | |
|
39 | 39 | class ChartThemeManager: public QObject |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | public: |
|
43 | 43 | enum BackgroundShadesMode { |
|
44 | 44 | BackgroundShadesNone = 0, |
|
45 | 45 | BackgroundShadesVertical, |
|
46 | 46 | BackgroundShadesHorizontal, |
|
47 | 47 | BackgroundShadesBoth |
|
48 | 48 | }; |
|
49 | 49 | |
|
50 | 50 | public: |
|
51 | 51 | explicit ChartThemeManager(QChart* chart); |
|
52 | 52 | void setTheme(QChart::ChartTheme theme); |
|
53 | 53 | ChartTheme* theme() const { return m_theme.data(); } |
|
54 | 54 | void decorateChart(QChart *chart, ChartTheme* theme) const; |
|
55 | 55 | void decorateLegend(QLegend *legend, ChartTheme* theme) const; |
|
56 | 56 | void updateSeries(QAbstractSeries *series); |
|
57 | 57 | |
|
58 | 58 | public: |
|
59 | 59 | static QList<QGradient> generateSeriesGradients(const QList<QColor>& colors); |
|
60 | 60 | static QColor colorAt(const QColor &start, const QColor &end, qreal pos); |
|
61 | 61 | static QColor colorAt(const QGradient &gradient, qreal pos); |
|
62 | 62 | |
|
63 | 63 | private: |
|
64 | 64 | int createIndexKey(QList<int> keys) const; |
|
65 | 65 | int seriesCount(QAbstractSeries::SeriesType type) const; |
|
66 | 66 | |
|
67 | 67 | public Q_SLOTS: |
|
68 | 68 | void handleSeriesAdded(QAbstractSeries *series); |
|
69 | 69 | void handleSeriesRemoved(QAbstractSeries *series); |
|
70 | 70 | void handleAxisAdded(QAbstractAxis *axis); |
|
71 | 71 | void handleAxisRemoved(QAbstractAxis *axis); |
|
72 | 72 | |
|
73 | 73 | protected: |
|
74 | 74 | QScopedPointer<ChartTheme> m_theme; |
|
75 | 75 | QMap<QAbstractSeries *,int> m_seriesMap; |
|
76 | 76 | QList<QAbstractAxis *> m_axisList; |
|
77 | 77 | QChart* m_chart; |
|
78 | 78 | }; |
|
79 | 79 | |
|
80 | 80 | QT_CHARTS_END_NAMESPACE |
|
81 | 81 | |
|
82 | 82 | #endif // CHARTTHEME_H |
@@ -1,51 +1,51 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTITLE_P_H_ |
|
29 | 29 | #define CHARTTITLE_P_H_ |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtWidgets/QGraphicsTextItem> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class ChartTitle : public QGraphicsTextItem |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | ChartTitle(QGraphicsItem *parent = 0); |
|
40 | 40 | ~ChartTitle(); |
|
41 | 41 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
42 | 42 | void setText(const QString &text); |
|
43 | 43 | QString text() const; |
|
44 | 44 | void setGeometry(const QRectF &rect); |
|
45 | 45 | private: |
|
46 | 46 | QString m_text; |
|
47 | 47 | }; |
|
48 | 48 | |
|
49 | 49 | QT_CHARTS_END_NAMESPACE |
|
50 | 50 | |
|
51 | 51 | #endif /* CHARTTITLE_P_H_ */ |
@@ -1,130 +1,130 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef ABSTRACTDOMAIN_H |
|
29 | 29 | #define ABSTRACTDOMAIN_H |
|
30 | 30 | #include <QtCharts/QChartGlobal> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | #include <QtCore/QDebug> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class QAbstractAxis; |
|
38 | 38 | |
|
39 | 39 | class QT_CHARTS_AUTOTEST_EXPORT AbstractDomain: public QObject |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | public: |
|
43 | 43 | enum DomainType { UndefinedDomain, |
|
44 | 44 | XYDomain, |
|
45 | 45 | XLogYDomain, |
|
46 | 46 | LogXYDomain, |
|
47 | 47 | LogXLogYDomain, |
|
48 | 48 | XYPolarDomain, |
|
49 | 49 | XLogYPolarDomain, |
|
50 | 50 | LogXYPolarDomain, |
|
51 | 51 | LogXLogYPolarDomain }; |
|
52 | 52 | public: |
|
53 | 53 | explicit AbstractDomain(QObject *object = 0); |
|
54 | 54 | virtual ~AbstractDomain(); |
|
55 | 55 | |
|
56 | 56 | virtual void setSize(const QSizeF &size); |
|
57 | 57 | QSizeF size() const; |
|
58 | 58 | |
|
59 | 59 | virtual DomainType type() = 0; |
|
60 | 60 | |
|
61 | 61 | virtual void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY) = 0; |
|
62 | 62 | void setRangeX(qreal min, qreal max); |
|
63 | 63 | void setRangeY(qreal min, qreal max); |
|
64 | 64 | void setMinX(qreal min); |
|
65 | 65 | void setMaxX(qreal max); |
|
66 | 66 | void setMinY(qreal min); |
|
67 | 67 | void setMaxY(qreal max); |
|
68 | 68 | |
|
69 | 69 | qreal minX() const { return m_minX; } |
|
70 | 70 | qreal maxX() const { return m_maxX; } |
|
71 | 71 | qreal minY() const { return m_minY; } |
|
72 | 72 | qreal maxY() const { return m_maxY; } |
|
73 | 73 | |
|
74 | 74 | qreal spanX() const; |
|
75 | 75 | qreal spanY() const; |
|
76 | 76 | bool isEmpty() const; |
|
77 | 77 | |
|
78 | 78 | void blockRangeSignals(bool block); |
|
79 | 79 | bool rangeSignalsBlocked() const { return m_signalsBlocked; } |
|
80 | 80 | |
|
81 | 81 | void zoomReset(); |
|
82 | 82 | void storeZoomReset(); |
|
83 | 83 | bool isZoomed() { return m_zoomed; } |
|
84 | 84 | |
|
85 | 85 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const AbstractDomain &domain1, const AbstractDomain &domain2); |
|
86 | 86 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const AbstractDomain &domain1, const AbstractDomain &domain2); |
|
87 | 87 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const AbstractDomain &domain); |
|
88 | 88 | |
|
89 | 89 | virtual void zoomIn(const QRectF &rect) = 0; |
|
90 | 90 | virtual void zoomOut(const QRectF &rect) = 0; |
|
91 | 91 | virtual void move(qreal dx, qreal dy) = 0; |
|
92 | 92 | |
|
93 | 93 | virtual QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const = 0; |
|
94 | 94 | virtual QPointF calculateDomainPoint(const QPointF &point) const = 0; |
|
95 | 95 | virtual QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const = 0; |
|
96 | 96 | |
|
97 | 97 | virtual bool attachAxis(QAbstractAxis *axis); |
|
98 | 98 | virtual bool detachAxis(QAbstractAxis *axis); |
|
99 | 99 | |
|
100 | 100 | static void looseNiceNumbers(qreal &min, qreal &max, int &ticksCount); |
|
101 | 101 | static qreal niceNumber(qreal x, bool ceiling); |
|
102 | 102 | |
|
103 | 103 | Q_SIGNALS: |
|
104 | 104 | void updated(); |
|
105 | 105 | void rangeHorizontalChanged(qreal min, qreal max); |
|
106 | 106 | void rangeVerticalChanged(qreal min, qreal max); |
|
107 | 107 | |
|
108 | 108 | public Q_SLOTS: |
|
109 | 109 | void handleVerticalAxisRangeChanged(qreal min,qreal max); |
|
110 | 110 | void handleHorizontalAxisRangeChanged(qreal min,qreal max); |
|
111 | 111 | |
|
112 | 112 | protected: |
|
113 | 113 | void adjustLogDomainRanges(qreal &min, qreal &max); |
|
114 | 114 | |
|
115 | 115 | qreal m_minX; |
|
116 | 116 | qreal m_maxX; |
|
117 | 117 | qreal m_minY; |
|
118 | 118 | qreal m_maxY; |
|
119 | 119 | QSizeF m_size; |
|
120 | 120 | bool m_signalsBlocked; |
|
121 | 121 | bool m_zoomed; |
|
122 | 122 | qreal m_zoomResetMinX; |
|
123 | 123 | qreal m_zoomResetMaxX; |
|
124 | 124 | qreal m_zoomResetMinY; |
|
125 | 125 | qreal m_zoomResetMaxY; |
|
126 | 126 | }; |
|
127 | 127 | |
|
128 | 128 | QT_CHARTS_END_NAMESPACE |
|
129 | 129 | |
|
130 | 130 | #endif // ABSTRACTDOMAIN_H |
@@ -1,77 +1,77 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LOGXLOGYDOMAIN_H |
|
29 | 29 | #define LOGXLOGYDOMAIN_H |
|
30 | 30 | #include <private/abstractdomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT LogXLogYDomain: public AbstractDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit LogXLogYDomain(QObject *object = 0); |
|
41 | 41 | virtual ~LogXLogYDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type(){ return AbstractDomain::LogXLogYDomain;} |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const LogXLogYDomain &domain1, const LogXLogYDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const LogXLogYDomain &domain1, const LogXLogYDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const LogXLogYDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; |
|
56 | 56 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
57 | 57 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const; |
|
58 | 58 | |
|
59 | 59 | bool attachAxis(QAbstractAxis *axis); |
|
60 | 60 | bool detachAxis(QAbstractAxis *axis); |
|
61 | 61 | |
|
62 | 62 | public Q_SLOTS: |
|
63 | 63 | void handleVerticalAxisBaseChanged(qreal baseY); |
|
64 | 64 | void handleHorizontalAxisBaseChanged(qreal baseX); |
|
65 | 65 | |
|
66 | 66 | private: |
|
67 | 67 | qreal m_logLeftX; |
|
68 | 68 | qreal m_logRightX; |
|
69 | 69 | qreal m_logBaseX; |
|
70 | 70 | qreal m_logLeftY; |
|
71 | 71 | qreal m_logRightY; |
|
72 | 72 | qreal m_logBaseY; |
|
73 | 73 | }; |
|
74 | 74 | |
|
75 | 75 | QT_CHARTS_END_NAMESPACE |
|
76 | 76 | |
|
77 | 77 | #endif // LOGXLOGYDOMAIN_H |
@@ -1,79 +1,79 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LOGXLOGYPOLARDOMAIN_H |
|
29 | 29 | #define LOGXLOGYPOLARDOMAIN_H |
|
30 | 30 | #include <private/polardomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT LogXLogYPolarDomain: public PolarDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit LogXLogYPolarDomain(QObject *object = 0); |
|
41 | 41 | virtual ~LogXLogYPolarDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type() { return AbstractDomain::LogXLogYPolarDomain; } |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const LogXLogYPolarDomain &domain1, const LogXLogYPolarDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const LogXLogYPolarDomain &domain1, const LogXLogYPolarDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const LogXLogYPolarDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
56 | 56 | |
|
57 | 57 | bool attachAxis(QAbstractAxis *axis); |
|
58 | 58 | bool detachAxis(QAbstractAxis *axis); |
|
59 | 59 | |
|
60 | 60 | public Q_SLOTS: |
|
61 | 61 | void handleVerticalAxisBaseChanged(qreal baseY); |
|
62 | 62 | void handleHorizontalAxisBaseChanged(qreal baseX); |
|
63 | 63 | |
|
64 | 64 | protected: |
|
65 | 65 | qreal toAngularCoordinate(qreal value, bool &ok) const; |
|
66 | 66 | qreal toRadialCoordinate(qreal value, bool &ok) const; |
|
67 | 67 | |
|
68 | 68 | private: |
|
69 | 69 | qreal m_logLeftX; |
|
70 | 70 | qreal m_logRightX; |
|
71 | 71 | qreal m_logBaseX; |
|
72 | 72 | qreal m_logInnerY; |
|
73 | 73 | qreal m_logOuterY; |
|
74 | 74 | qreal m_logBaseY; |
|
75 | 75 | }; |
|
76 | 76 | |
|
77 | 77 | QT_CHARTS_END_NAMESPACE |
|
78 | 78 | |
|
79 | 79 | #endif // LOGXLOGYPOLARDOMAIN_H |
@@ -1,73 +1,73 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LOGXYDOMAIN_H |
|
29 | 29 | #define LOGXYDOMAIN_H |
|
30 | 30 | #include <private/abstractdomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT LogXYDomain: public AbstractDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit LogXYDomain(QObject *object = 0); |
|
41 | 41 | virtual ~LogXYDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type(){ return AbstractDomain::LogXYDomain;} |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const LogXYDomain &domain1, const LogXYDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const LogXYDomain &domain1, const LogXYDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const LogXYDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; |
|
56 | 56 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
57 | 57 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const; |
|
58 | 58 | |
|
59 | 59 | bool attachAxis(QAbstractAxis *axis); |
|
60 | 60 | bool detachAxis(QAbstractAxis *axis); |
|
61 | 61 | |
|
62 | 62 | public Q_SLOTS: |
|
63 | 63 | void handleHorizontalAxisBaseChanged(qreal baseX); |
|
64 | 64 | |
|
65 | 65 | private: |
|
66 | 66 | qreal m_logLeftX; |
|
67 | 67 | qreal m_logRightX; |
|
68 | 68 | qreal m_logBaseX; |
|
69 | 69 | }; |
|
70 | 70 | |
|
71 | 71 | QT_CHARTS_END_NAMESPACE |
|
72 | 72 | |
|
73 | 73 | #endif // LOGXYDOMAIN_H |
@@ -1,75 +1,75 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LOGXYPOLARDOMAIN_H |
|
29 | 29 | #define LOGXYPOLARDOMAIN_H |
|
30 | 30 | #include <private/polardomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT LogXYPolarDomain: public PolarDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit LogXYPolarDomain(QObject *object = 0); |
|
41 | 41 | virtual ~LogXYPolarDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type() { return AbstractDomain::LogXYPolarDomain; } |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const LogXYPolarDomain &domain1, const LogXYPolarDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const LogXYPolarDomain &domain1, const LogXYPolarDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const LogXYPolarDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
56 | 56 | |
|
57 | 57 | bool attachAxis(QAbstractAxis *axis); |
|
58 | 58 | bool detachAxis(QAbstractAxis *axis); |
|
59 | 59 | |
|
60 | 60 | public Q_SLOTS: |
|
61 | 61 | void handleHorizontalAxisBaseChanged(qreal baseX); |
|
62 | 62 | |
|
63 | 63 | protected: |
|
64 | 64 | qreal toAngularCoordinate(qreal value, bool &ok) const; |
|
65 | 65 | qreal toRadialCoordinate(qreal value, bool &ok) const; |
|
66 | 66 | |
|
67 | 67 | private: |
|
68 | 68 | qreal m_logLeftX; |
|
69 | 69 | qreal m_logRightX; |
|
70 | 70 | qreal m_logBaseX; |
|
71 | 71 | }; |
|
72 | 72 | |
|
73 | 73 | QT_CHARTS_END_NAMESPACE |
|
74 | 74 | |
|
75 | 75 | #endif // LOGXYPOLARDOMAIN_H |
@@ -1,60 +1,60 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARDOMAIN_H |
|
29 | 29 | #define POLARDOMAIN_H |
|
30 | 30 | #include <private/abstractdomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT PolarDomain: public AbstractDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit PolarDomain(QObject *object = 0); |
|
41 | 41 | virtual ~PolarDomain(); |
|
42 | 42 | |
|
43 | 43 | void setSize(const QSizeF &size); |
|
44 | 44 | |
|
45 | 45 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; |
|
46 | 46 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const; |
|
47 | 47 | |
|
48 | 48 | virtual qreal toAngularCoordinate(qreal value, bool &ok) const = 0; |
|
49 | 49 | virtual qreal toRadialCoordinate(qreal value, bool &ok) const = 0; |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | QPointF polarCoordinateToPoint(qreal angularCoordinate, qreal radialCoordinate) const; |
|
53 | 53 | |
|
54 | 54 | QPointF m_center; |
|
55 | 55 | qreal m_radius; |
|
56 | 56 | }; |
|
57 | 57 | |
|
58 | 58 | QT_CHARTS_END_NAMESPACE |
|
59 | 59 | |
|
60 | 60 | #endif // POLARDOMAIN_H |
@@ -1,73 +1,73 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XLOGYDOMAIN_H |
|
29 | 29 | #define XLOGYDOMAIN_H |
|
30 | 30 | #include <private/abstractdomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT XLogYDomain: public AbstractDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit XLogYDomain(QObject *object = 0); |
|
41 | 41 | virtual ~XLogYDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type(){ return AbstractDomain::XLogYDomain;}; |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const XLogYDomain &domain1, const XLogYDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const XLogYDomain &domain1, const XLogYDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const XLogYDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; |
|
56 | 56 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
57 | 57 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const; |
|
58 | 58 | |
|
59 | 59 | bool attachAxis(QAbstractAxis *axis); |
|
60 | 60 | bool detachAxis(QAbstractAxis *axis); |
|
61 | 61 | |
|
62 | 62 | public Q_SLOTS: |
|
63 | 63 | void handleVerticalAxisBaseChanged(qreal baseY); |
|
64 | 64 | |
|
65 | 65 | private: |
|
66 | 66 | qreal m_logLeftY; |
|
67 | 67 | qreal m_logRightY; |
|
68 | 68 | qreal m_logBaseY; |
|
69 | 69 | }; |
|
70 | 70 | |
|
71 | 71 | QT_CHARTS_END_NAMESPACE |
|
72 | 72 | |
|
73 | 73 | #endif // XLOGYDOMAIN_H |
@@ -1,75 +1,75 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XLOGYPOLARDOMAIN_H |
|
29 | 29 | #define XLOGYPOLARDOMAIN_H |
|
30 | 30 | #include <private/polardomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT XLogYPolarDomain: public PolarDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit XLogYPolarDomain(QObject *object = 0); |
|
41 | 41 | virtual ~XLogYPolarDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type() { return AbstractDomain::XLogYPolarDomain; } |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const XLogYPolarDomain &domain1, const XLogYPolarDomain &domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const XLogYPolarDomain &domain1, const XLogYPolarDomain &domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const XLogYPolarDomain &domain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
56 | 56 | |
|
57 | 57 | bool attachAxis(QAbstractAxis *axis); |
|
58 | 58 | bool detachAxis(QAbstractAxis *axis); |
|
59 | 59 | |
|
60 | 60 | public Q_SLOTS: |
|
61 | 61 | void handleVerticalAxisBaseChanged(qreal baseY); |
|
62 | 62 | |
|
63 | 63 | protected: |
|
64 | 64 | qreal toAngularCoordinate(qreal value, bool &ok) const; |
|
65 | 65 | qreal toRadialCoordinate(qreal value, bool &ok) const; |
|
66 | 66 | |
|
67 | 67 | private: |
|
68 | 68 | qreal m_logInnerY; |
|
69 | 69 | qreal m_logOuterY; |
|
70 | 70 | qreal m_logBaseY; |
|
71 | 71 | }; |
|
72 | 72 | |
|
73 | 73 | QT_CHARTS_END_NAMESPACE |
|
74 | 74 | |
|
75 | 75 | #endif // XLOGYPOLARDOMAIN_H |
@@ -1,62 +1,62 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XYDOMAIN_H |
|
29 | 29 | #define XYDOMAIN_H |
|
30 | 30 | #include <private/abstractdomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | #include <QtCore/QSizeF> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_AUTOTEST_EXPORT XYDomain: public AbstractDomain |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | explicit XYDomain(QObject *object = 0); |
|
41 | 41 | virtual ~XYDomain(); |
|
42 | 42 | |
|
43 | 43 | DomainType type(){ return AbstractDomain::XYDomain;} |
|
44 | 44 | |
|
45 | 45 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
46 | 46 | |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const XYDomain &Domain1, const XYDomain &Domain2); |
|
48 | 48 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const XYDomain &Domain1, const XYDomain &Domain2); |
|
49 | 49 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const XYDomain &AbstractDomain); |
|
50 | 50 | |
|
51 | 51 | void zoomIn(const QRectF &rect); |
|
52 | 52 | void zoomOut(const QRectF &rect); |
|
53 | 53 | void move(qreal dx, qreal dy); |
|
54 | 54 | |
|
55 | 55 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; |
|
56 | 56 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
57 | 57 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF> &vector) const; |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | QT_CHARTS_END_NAMESPACE |
|
61 | 61 | |
|
62 | 62 | #endif // XYDOMAIN_H |
@@ -1,63 +1,63 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XYPOLARDOMAIN_H |
|
29 | 29 | #define XYPOLARDOMAIN_H |
|
30 | 30 | #include <private/polardomain_p.h> |
|
31 | 31 | #include <QtCore/QRectF> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QT_CHARTS_AUTOTEST_EXPORT XYPolarDomain: public PolarDomain |
|
36 | 36 | { |
|
37 | 37 | Q_OBJECT |
|
38 | 38 | public: |
|
39 | 39 | explicit XYPolarDomain(QObject *object = 0); |
|
40 | 40 | virtual ~XYPolarDomain(); |
|
41 | 41 | |
|
42 | 42 | DomainType type(){ return AbstractDomain::XYPolarDomain;} |
|
43 | 43 | |
|
44 | 44 | void setRange(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
45 | 45 | |
|
46 | 46 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator== (const XYPolarDomain &Domain1, const XYPolarDomain &Domain2); |
|
47 | 47 | friend bool QT_CHARTS_AUTOTEST_EXPORT operator!= (const XYPolarDomain &Domain1, const XYPolarDomain &Domain2); |
|
48 | 48 | friend QDebug QT_CHARTS_AUTOTEST_EXPORT operator<<(QDebug dbg, const XYPolarDomain &AbstractDomain); |
|
49 | 49 | |
|
50 | 50 | void zoomIn(const QRectF &rect); |
|
51 | 51 | void zoomOut(const QRectF &rect); |
|
52 | 52 | void move(qreal dx, qreal dy); |
|
53 | 53 | |
|
54 | 54 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
55 | 55 | |
|
56 | 56 | protected: |
|
57 | 57 | qreal toAngularCoordinate(qreal value, bool &ok) const; |
|
58 | 58 | qreal toRadialCoordinate(qreal value, bool &ok) const; |
|
59 | 59 | }; |
|
60 | 60 | |
|
61 | 61 | QT_CHARTS_END_NAMESPACE |
|
62 | 62 | |
|
63 | 63 | #endif // XYPOLARDOMAIN_H |
@@ -1,80 +1,80 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef ABSTRACTCHARTLAYOUT_H |
|
29 | 29 | #define ABSTRACTCHARTLAYOUT_H |
|
30 | 30 | |
|
31 | 31 | #include <QtWidgets/QGraphicsLayout> |
|
32 | 32 | #include <QtCore/QMargins> |
|
33 | 33 | #include <QtCharts/QChartGlobal> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class ChartTitle; |
|
38 | 38 | class ChartAxisElement; |
|
39 | 39 | class ChartPresenter; |
|
40 | 40 | class QLegend; |
|
41 | 41 | class ChartBackground; |
|
42 | 42 | |
|
43 | 43 | class AbstractChartLayout : public QGraphicsLayout |
|
44 | 44 | { |
|
45 | 45 | public: |
|
46 | 46 | AbstractChartLayout(ChartPresenter *presenter); |
|
47 | 47 | virtual ~AbstractChartLayout(); |
|
48 | 48 | |
|
49 | 49 | virtual void setMargins(const QMargins &margins); |
|
50 | 50 | virtual QMargins margins() const; |
|
51 | 51 | virtual void setGeometry(const QRectF &rect); |
|
52 | 52 | |
|
53 | 53 | protected: |
|
54 | 54 | virtual QRectF calculateBackgroundGeometry(const QRectF &geometry, ChartBackground *background) const; |
|
55 | 55 | virtual QRectF calculateBackgroundMinimum(const QRectF &minimum) const; |
|
56 | 56 | virtual QRectF calculateContentGeometry(const QRectF &geometry) const; |
|
57 | 57 | virtual QRectF calculateContentMinimum(const QRectF &minimum) const; |
|
58 | 58 | virtual QRectF calculateTitleGeometry(const QRectF &geometry, ChartTitle *title) const; |
|
59 | 59 | virtual QRectF calculateTitleMinimum(const QRectF &minimum, ChartTitle *title) const; |
|
60 | 60 | virtual QRectF calculateLegendGeometry(const QRectF &geometry, QLegend *legend) const; |
|
61 | 61 | virtual QRectF calculateLegendMinimum(const QRectF &minimum, QLegend *legend) const; |
|
62 | 62 | |
|
63 | 63 | virtual QRectF calculateAxisGeometry(const QRectF &geometry, const QList<ChartAxisElement *>& axes) const = 0; |
|
64 | 64 | virtual QRectF calculateAxisMinimum(const QRectF &minimum, const QList<ChartAxisElement *>& axes) const = 0; |
|
65 | 65 | |
|
66 | 66 | // from QGraphicsLayout |
|
67 | 67 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
68 | 68 | int count() const { return 0; } |
|
69 | 69 | QGraphicsLayoutItem *itemAt(int) const { return 0; }; |
|
70 | 70 | void removeAt(int) {}; |
|
71 | 71 | |
|
72 | 72 | ChartPresenter *m_presenter; |
|
73 | 73 | QMargins m_margins; |
|
74 | 74 | QRectF m_minChartRect; |
|
75 | 75 | QRectF m_minAxisRect; |
|
76 | 76 | }; |
|
77 | 77 | |
|
78 | 78 | QT_CHARTS_END_NAMESPACE |
|
79 | 79 | |
|
80 | 80 | #endif // ABSTRACTCHARTLAYOUT_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CARTESIANCHARTLAYOUT_H |
|
29 | 29 | #define CARTESIANCHARTLAYOUT_H |
|
30 | 30 | |
|
31 | 31 | #include <private/abstractchartlayout_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class CartesianChartLayout : public AbstractChartLayout |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | CartesianChartLayout(ChartPresenter *presenter); |
|
39 | 39 | virtual ~CartesianChartLayout(); |
|
40 | 40 | |
|
41 | 41 | // from AbstractChartLayout |
|
42 | 42 | QRectF calculateAxisMinimum(const QRectF &minimum, const QList<ChartAxisElement *> &axes) const; |
|
43 | 43 | QRectF calculateAxisGeometry(const QRectF &geometry, const QList<ChartAxisElement *> &axes) const; |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif // CARTESIANCHARTLAYOUT_H |
@@ -1,48 +1,48 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef POLARCHARTLAYOUT_H |
|
29 | 29 | #define POLARCHARTLAYOUT_H |
|
30 | 30 | |
|
31 | 31 | #include <private/abstractchartlayout_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class PolarChartLayout : public AbstractChartLayout |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | PolarChartLayout(ChartPresenter *presenter); |
|
39 | 39 | virtual ~PolarChartLayout(); |
|
40 | 40 | |
|
41 | 41 | // from AbstractChartLayout |
|
42 | 42 | QRectF calculateAxisMinimum(const QRectF &minimum, const QList<ChartAxisElement *> &axes) const; |
|
43 | 43 | QRectF calculateAxisGeometry(const QRectF &geometry, const QList<ChartAxisElement *> &axes) const; |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | QT_CHARTS_END_NAMESPACE |
|
47 | 47 | |
|
48 | 48 | #endif // POLARCHARTLAYOUT_H |
@@ -1,82 +1,82 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LEGENDLAYOUT_H |
|
29 | 29 | #define LEGENDLAYOUT_H |
|
30 | 30 | #include <QtWidgets/QGraphicsLayout> |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QLegend; |
|
36 | 36 | class LegendMarkerItem; |
|
37 | 37 | |
|
38 | 38 | class LegendLayout : public QGraphicsLayout |
|
39 | 39 | { |
|
40 | 40 | public: |
|
41 | 41 | |
|
42 | 42 | LegendLayout(QLegend *legend); |
|
43 | 43 | virtual ~LegendLayout(); |
|
44 | 44 | |
|
45 | 45 | void setGeometry(const QRectF &rect); |
|
46 | 46 | |
|
47 | 47 | void setOffset(qreal x, qreal y); |
|
48 | 48 | QPointF offset() const; |
|
49 | 49 | |
|
50 | 50 | void invalidate(); |
|
51 | 51 | protected: |
|
52 | 52 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; |
|
53 | 53 | int count() const { return 0; } |
|
54 | 54 | QGraphicsLayoutItem *itemAt(int) const { return 0; }; |
|
55 | 55 | void removeAt(int) {}; |
|
56 | 56 | |
|
57 | 57 | private: |
|
58 | 58 | void setAttachedGeometry(const QRectF &rect); |
|
59 | 59 | void setDettachedGeometry(const QRectF &rect); |
|
60 | 60 | |
|
61 | 61 | struct LegendWidthStruct { |
|
62 | 62 | LegendMarkerItem *item; |
|
63 | 63 | qreal width; |
|
64 | 64 | }; |
|
65 | 65 | static bool widthLongerThan(const LegendWidthStruct *item1, |
|
66 | 66 | const LegendWidthStruct *item2); |
|
67 | 67 | |
|
68 | 68 | private: |
|
69 | 69 | QLegend *m_legend; |
|
70 | 70 | qreal m_offsetX; |
|
71 | 71 | qreal m_offsetY; |
|
72 | 72 | qreal m_minOffsetX; |
|
73 | 73 | qreal m_minOffsetY; |
|
74 | 74 | qreal m_maxOffsetX; |
|
75 | 75 | qreal m_maxOffsetY; |
|
76 | 76 | qreal m_width; |
|
77 | 77 | qreal m_height; |
|
78 | 78 | }; |
|
79 | 79 | |
|
80 | 80 | QT_CHARTS_END_NAMESPACE |
|
81 | 81 | |
|
82 | 82 | #endif |
@@ -1,99 +1,99 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LEGENDMARKERITEM_P_H |
|
29 | 29 | #define LEGENDMARKERITEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QGraphicsObject> |
|
33 | 33 | #include <QtGui/QFont> |
|
34 | 34 | #include <QtGui/QBrush> |
|
35 | 35 | #include <QtGui/QPen> |
|
36 | 36 | #include <QtWidgets/QGraphicsTextItem> |
|
37 | 37 | #include <QtWidgets/QGraphicsLayoutItem> |
|
38 | 38 | |
|
39 | 39 | QT_CHARTS_BEGIN_NAMESPACE |
|
40 | 40 | |
|
41 | 41 | class QLegendMarkerPrivate; |
|
42 | 42 | |
|
43 | 43 | class LegendMarkerItem : public QGraphicsObject, public QGraphicsLayoutItem |
|
44 | 44 | { |
|
45 | 45 | Q_OBJECT |
|
46 | 46 | Q_INTERFACES(QGraphicsLayoutItem) |
|
47 | 47 | public: |
|
48 | 48 | explicit LegendMarkerItem(QLegendMarkerPrivate *marker, QGraphicsObject *parent = 0); |
|
49 | 49 | ~LegendMarkerItem(); |
|
50 | 50 | |
|
51 | 51 | void setPen(const QPen &pen); |
|
52 | 52 | QPen pen() const; |
|
53 | 53 | |
|
54 | 54 | void setBrush(const QBrush &brush); |
|
55 | 55 | QBrush brush() const; |
|
56 | 56 | |
|
57 | 57 | void setFont(const QFont &font); |
|
58 | 58 | QFont font() const; |
|
59 | 59 | |
|
60 | 60 | void setLabel(const QString label); |
|
61 | 61 | QString label() const; |
|
62 | 62 | |
|
63 | 63 | void setLabelBrush(const QBrush &brush); |
|
64 | 64 | QBrush labelBrush() const; |
|
65 | 65 | |
|
66 | 66 | void setGeometry(const QRectF &rect); |
|
67 | 67 | QRectF boundingRect() const; |
|
68 | 68 | |
|
69 | 69 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); |
|
70 | 70 | QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint) const; |
|
71 | 71 | |
|
72 | 72 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
73 | 73 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
74 | 74 | |
|
75 | 75 | protected: |
|
76 | 76 | QLegendMarkerPrivate *m_marker; // Knows |
|
77 | 77 | QRectF m_markerRect; |
|
78 | 78 | QRectF m_boundingRect; |
|
79 | 79 | QGraphicsTextItem *m_textItem; |
|
80 | 80 | QGraphicsRectItem *m_rectItem; |
|
81 | 81 | qreal m_margin; |
|
82 | 82 | qreal m_space; |
|
83 | 83 | QString m_label; |
|
84 | 84 | |
|
85 | 85 | QBrush m_labelBrush; |
|
86 | 86 | QPen m_pen; |
|
87 | 87 | QBrush m_brush; |
|
88 | 88 | bool m_hovering; |
|
89 | 89 | |
|
90 | 90 | QPointF m_pressPos; |
|
91 | 91 | |
|
92 | 92 | friend class QLegendMarker; |
|
93 | 93 | friend class QLegendMarkerPrivate; |
|
94 | 94 | friend class LegendLayout; |
|
95 | 95 | }; |
|
96 | 96 | |
|
97 | 97 | QT_CHARTS_END_NAMESPACE |
|
98 | 98 | |
|
99 | 99 | #endif // LEGENDMARKERITEM_P_H |
@@ -1,55 +1,55 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | #ifndef LEGENDSCROLLER_P_H |
|
30 | 30 | #define LEGENDSCROLLER_P_H |
|
31 | 31 | |
|
32 | 32 | #include <QtCharts/qlegend.h> |
|
33 | 33 | #include <private/qlegend_p.h> |
|
34 | 34 | #include <private/scroller_p.h> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class LegendScroller: public QLegend, public Scroller |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | LegendScroller(QChart *chart); |
|
44 | 44 | |
|
45 | 45 | void setOffset(const QPointF &point); |
|
46 | 46 | QPointF offset() const; |
|
47 | 47 | |
|
48 | 48 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
49 | 49 | void mouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
50 | 50 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
51 | 51 | }; |
|
52 | 52 | |
|
53 | 53 | QT_CHARTS_END_NAMESPACE |
|
54 | 54 | |
|
55 | 55 | #endif |
@@ -1,62 +1,62 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QAREALEGENDMARKER_P_H |
|
29 | 29 | #define QAREALEGENDMARKER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/qlegendmarker_p.h> |
|
33 | 33 | #include <private/legendmarkeritem_p.h> |
|
34 | 34 | #include <QtCharts/QAreaSeries> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QAreaLegendMarker; |
|
39 | 39 | |
|
40 | 40 | class QAreaLegendMarkerPrivate : public QLegendMarkerPrivate |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | public: |
|
44 | 44 | explicit QAreaLegendMarkerPrivate(QAreaLegendMarker *q, QAreaSeries *series, QLegend *legend); |
|
45 | 45 | virtual ~QAreaLegendMarkerPrivate(); |
|
46 | 46 | |
|
47 | 47 | virtual QAreaSeries* series(); |
|
48 | 48 | virtual QObject* relatedObject(); |
|
49 | 49 | |
|
50 | 50 | public Q_SLOTS: |
|
51 | 51 | virtual void updated(); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QAreaLegendMarker *q_ptr; |
|
55 | 55 | QAreaSeries *m_series; |
|
56 | 56 | |
|
57 | 57 | Q_DECLARE_PUBLIC(QAreaLegendMarker) |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | QT_CHARTS_END_NAMESPACE |
|
61 | 61 | |
|
62 | 62 | #endif // QAREALEGENDMARKER_P_H |
@@ -1,64 +1,64 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBARLEGENDMARKER_P_H |
|
29 | 29 | #define QBARLEGENDMARKER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/qlegendmarker_p.h> |
|
33 | 33 | #include <private/legendmarkeritem_p.h> |
|
34 | 34 | #include <QtCharts/QAbstractBarSeries> |
|
35 | 35 | #include <QtCharts/QBarSet> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QBarLegendMarker; |
|
40 | 40 | |
|
41 | 41 | class QBarLegendMarkerPrivate : public QLegendMarkerPrivate |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | public: |
|
45 | 45 | explicit QBarLegendMarkerPrivate(QBarLegendMarker *q, QAbstractBarSeries *series, QBarSet *barset, QLegend *legend); |
|
46 | 46 | virtual ~QBarLegendMarkerPrivate(); |
|
47 | 47 | |
|
48 | 48 | virtual QAbstractBarSeries* series(); |
|
49 | 49 | virtual QObject* relatedObject(); |
|
50 | 50 | |
|
51 | 51 | public Q_SLOTS: |
|
52 | 52 | virtual void updated(); |
|
53 | 53 | |
|
54 | 54 | private: |
|
55 | 55 | QBarLegendMarker *q_ptr; |
|
56 | 56 | QAbstractBarSeries *m_series; |
|
57 | 57 | QBarSet *m_barset; |
|
58 | 58 | |
|
59 | 59 | Q_DECLARE_PUBLIC(QBarLegendMarker) |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | QT_CHARTS_END_NAMESPACE |
|
63 | 63 | |
|
64 | 64 | #endif // QBARLEGENDMARKER_P_H |
@@ -1,62 +1,62 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QBOXPLOTLEGENDMARKER_P_H |
|
29 | 29 | #define QBOXPLOTLEGENDMARKER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/qlegendmarker_p.h> |
|
33 | 33 | #include <private/legendmarkeritem_p.h> |
|
34 | 34 | #include <QtCharts/QBoxPlotSeries> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QBoxPlotLegendMarker; |
|
39 | 39 | |
|
40 | 40 | class QBoxPlotLegendMarkerPrivate : public QLegendMarkerPrivate |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | public: |
|
44 | 44 | explicit QBoxPlotLegendMarkerPrivate(QBoxPlotLegendMarker *q, QBoxPlotSeries *series, QLegend *legend); |
|
45 | 45 | virtual ~QBoxPlotLegendMarkerPrivate(); |
|
46 | 46 | |
|
47 | 47 | virtual QAbstractSeries *series(); |
|
48 | 48 | virtual QObject *relatedObject(); |
|
49 | 49 | |
|
50 | 50 | public Q_SLOTS: |
|
51 | 51 | virtual void updated(); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QBoxPlotLegendMarker *q_ptr; |
|
55 | 55 | QBoxPlotSeries *m_series; |
|
56 | 56 | |
|
57 | 57 | Q_DECLARE_PUBLIC(QBoxPlotLegendMarker) |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | QT_CHARTS_END_NAMESPACE |
|
61 | 61 | |
|
62 | 62 | #endif // QBOXPLOTLEGENDMARKER_P_H |
@@ -1,99 +1,99 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QLEGEND_P_H |
|
29 | 29 | #define QLEGEND_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QLegend> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QChart; |
|
36 | 36 | class ChartPresenter; |
|
37 | 37 | class QAbstractSeries; |
|
38 | 38 | class LegendLayout; |
|
39 | 39 | class QLegendMarker; |
|
40 | 40 | |
|
41 | 41 | class QLegendPrivate : public QObject |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | public: |
|
45 | 45 | QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q); |
|
46 | 46 | ~QLegendPrivate(); |
|
47 | 47 | |
|
48 | 48 | void setOffset(const QPointF &offset); |
|
49 | 49 | QPointF offset() const; |
|
50 | 50 | int roundness(qreal size); |
|
51 | 51 | |
|
52 | 52 | QGraphicsItemGroup* items() { return m_items; } |
|
53 | 53 | |
|
54 | 54 | QList<QLegendMarker*> markers(QAbstractSeries *series = 0); |
|
55 | 55 | |
|
56 | 56 | public Q_SLOTS: |
|
57 | 57 | void handleSeriesAdded(QAbstractSeries *series); |
|
58 | 58 | void handleSeriesRemoved(QAbstractSeries *series); |
|
59 | 59 | void handleSeriesVisibleChanged(); |
|
60 | 60 | void handleCountChanged(); |
|
61 | 61 | |
|
62 | 62 | private: |
|
63 | 63 | // Internal helpers |
|
64 | 64 | void addMarkers(QList<QLegendMarker *> markers); |
|
65 | 65 | void removeMarkers(QList<QLegendMarker *> markers); |
|
66 | 66 | void decorateMarkers(QList<QLegendMarker *> markers); |
|
67 | 67 | |
|
68 | 68 | private: |
|
69 | 69 | QLegend *q_ptr; |
|
70 | 70 | ChartPresenter *m_presenter; |
|
71 | 71 | LegendLayout *m_layout; |
|
72 | 72 | QChart *m_chart; |
|
73 | 73 | QGraphicsItemGroup *m_items; |
|
74 | 74 | Qt::Alignment m_alignment; |
|
75 | 75 | QBrush m_brush; |
|
76 | 76 | QPen m_pen; |
|
77 | 77 | QFont m_font; |
|
78 | 78 | QBrush m_labelBrush; |
|
79 | 79 | |
|
80 | 80 | qreal m_diameter; |
|
81 | 81 | bool m_attachedToChart; |
|
82 | 82 | bool m_backgroundVisible; |
|
83 | 83 | bool m_reverseMarkers; |
|
84 | 84 | |
|
85 | 85 | QList<QLegendMarker *> m_markers; |
|
86 | 86 | QList<QAbstractSeries *> m_series; |
|
87 | 87 | |
|
88 | 88 | QHash<QGraphicsItem *, QLegendMarker *> m_markerHash; |
|
89 | 89 | |
|
90 | 90 | friend class QLegend; |
|
91 | 91 | friend class LegendMarkerItem; |
|
92 | 92 | friend class LegendLayout; |
|
93 | 93 | friend class QLegendMarkerPrivate; |
|
94 | 94 | friend class LegendScroller; |
|
95 | 95 | }; |
|
96 | 96 | |
|
97 | 97 | QT_CHARTS_END_NAMESPACE |
|
98 | 98 | |
|
99 | 99 | #endif |
@@ -1,80 +1,80 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QLEGENDMARKERPRIVATE_H |
|
29 | 29 | #define QLEGENDMARKERPRIVATE_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QGraphicsObject> |
|
33 | 33 | #include <QtGui/QBrush> |
|
34 | 34 | #include <QtGui/QPen> |
|
35 | 35 | #include <QtWidgets/QGraphicsLayoutItem> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QAbstractSeries; |
|
40 | 40 | class QLegend; |
|
41 | 41 | |
|
42 | 42 | class QLegendMarker; |
|
43 | 43 | class LegendMarkerItem; |
|
44 | 44 | |
|
45 | 45 | class QLegendMarkerPrivate : public QObject |
|
46 | 46 | { |
|
47 | 47 | Q_OBJECT |
|
48 | 48 | public: |
|
49 | 49 | explicit QLegendMarkerPrivate(QLegendMarker *q, QLegend *legend); |
|
50 | 50 | virtual ~QLegendMarkerPrivate(); |
|
51 | 51 | |
|
52 | 52 | // Helper for now. (or declare LegendLayout as friend) |
|
53 | 53 | LegendMarkerItem* item() const { return m_item; } |
|
54 | 54 | |
|
55 | 55 | virtual QAbstractSeries* series() = 0; |
|
56 | 56 | virtual QObject* relatedObject() = 0; |
|
57 | 57 | |
|
58 | 58 | void invalidateLegend(); |
|
59 | 59 | |
|
60 | 60 | public Q_SLOTS: |
|
61 | 61 | virtual void updated() = 0; |
|
62 | 62 | |
|
63 | 63 | protected: |
|
64 | 64 | LegendMarkerItem *m_item; |
|
65 | 65 | QLegend *m_legend; |
|
66 | 66 | bool m_customLabel; |
|
67 | 67 | bool m_customBrush; |
|
68 | 68 | bool m_customPen; |
|
69 | 69 | |
|
70 | 70 | private: |
|
71 | 71 | QLegendMarker *q_ptr; |
|
72 | 72 | |
|
73 | 73 | friend class QLegendPrivate; |
|
74 | 74 | friend class LegendMarkerItem; |
|
75 | 75 | Q_DECLARE_PUBLIC(QLegendMarker) |
|
76 | 76 | }; |
|
77 | 77 | |
|
78 | 78 | QT_CHARTS_END_NAMESPACE |
|
79 | 79 | |
|
80 | 80 | #endif // QLEGENDMARKERPRIVATE_H |
@@ -1,66 +1,66 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QPIELEGENDMARKER_P_H |
|
29 | 29 | #define QPIELEGENDMARKER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/qlegendmarker_p.h> |
|
33 | 33 | #include <private/legendmarkeritem_p.h> |
|
34 | 34 | #include <QtCharts/QPieSeries> |
|
35 | 35 | #include <QtCharts/QPieSlice> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QPieLegendMarker; |
|
40 | 40 | |
|
41 | 41 | class QPieLegendMarkerPrivate : public QLegendMarkerPrivate |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | public: |
|
45 | 45 | explicit QPieLegendMarkerPrivate(QPieLegendMarker *q, QPieSeries *series, QPieSlice *slice, QLegend *legend); |
|
46 | 46 | virtual ~QPieLegendMarkerPrivate(); |
|
47 | 47 | |
|
48 | 48 | // internal |
|
49 | 49 | virtual QPieSeries* series(); |
|
50 | 50 | virtual QObject* relatedObject(); |
|
51 | 51 | |
|
52 | 52 | public Q_SLOTS: |
|
53 | 53 | virtual void updated(); |
|
54 | 54 | |
|
55 | 55 | private: |
|
56 | 56 | QPieLegendMarker *q_ptr; |
|
57 | 57 | |
|
58 | 58 | QPieSeries *m_series; |
|
59 | 59 | QPieSlice *m_slice; |
|
60 | 60 | |
|
61 | 61 | Q_DECLARE_PUBLIC(QPieLegendMarker) |
|
62 | 62 | }; |
|
63 | 63 | |
|
64 | 64 | QT_CHARTS_END_NAMESPACE |
|
65 | 65 | |
|
66 | 66 | #endif // QPIELEGENDMARKER_P_H |
@@ -1,62 +1,62 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QXYLEGENDMARKER_P_H |
|
29 | 29 | #define QXYLEGENDMARKER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/qlegendmarker_p.h> |
|
33 | 33 | #include <private/legendmarkeritem_p.h> |
|
34 | 34 | #include <QtCharts/QXYSeries> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QXYLegendMarker; |
|
39 | 39 | |
|
40 | 40 | class QXYLegendMarkerPrivate : public QLegendMarkerPrivate |
|
41 | 41 | { |
|
42 | 42 | Q_OBJECT |
|
43 | 43 | public: |
|
44 | 44 | explicit QXYLegendMarkerPrivate(QXYLegendMarker *q, QXYSeries *series, QLegend *legend); |
|
45 | 45 | virtual ~QXYLegendMarkerPrivate(); |
|
46 | 46 | |
|
47 | 47 | virtual QAbstractSeries* series(); |
|
48 | 48 | virtual QObject* relatedObject(); |
|
49 | 49 | |
|
50 | 50 | public Q_SLOTS: |
|
51 | 51 | virtual void updated(); |
|
52 | 52 | |
|
53 | 53 | private: |
|
54 | 54 | QXYLegendMarker *q_ptr; |
|
55 | 55 | QXYSeries *m_series; |
|
56 | 56 | |
|
57 | 57 | Q_DECLARE_PUBLIC(QXYLegendMarker) |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | QT_CHARTS_END_NAMESPACE |
|
61 | 61 | |
|
62 | 62 | #endif // QXYLEGENDMARKER_P_H |
@@ -1,94 +1,94 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef LINECHARTITEM_H |
|
29 | 29 | #define LINECHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/xychart_p.h> |
|
33 | 33 | #include <QtCharts/QChart> |
|
34 | 34 | #include <QtGui/QPen> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | class QLineSeries; |
|
39 | 39 | class ChartPresenter; |
|
40 | 40 | |
|
41 | 41 | class LineChartItem : public XYChart |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | Q_INTERFACES(QGraphicsItem) |
|
45 | 45 | public: |
|
46 | 46 | explicit LineChartItem(QLineSeries *series, QGraphicsItem *item = 0); |
|
47 | 47 | ~LineChartItem() {} |
|
48 | 48 | |
|
49 | 49 | //from QGraphicsItem |
|
50 | 50 | QRectF boundingRect() const; |
|
51 | 51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
52 | 52 | QPainterPath shape() const; |
|
53 | 53 | |
|
54 | 54 | QPainterPath path() const { return m_fullPath; } |
|
55 | 55 | |
|
56 | 56 | public Q_SLOTS: |
|
57 | 57 | void handleUpdated(); |
|
58 | 58 | |
|
59 | 59 | protected: |
|
60 | 60 | void updateGeometry(); |
|
61 | 61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
62 | 62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
63 | 63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
64 | 64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
65 | 65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
66 | 66 | void suppressPoints() { m_pointsVisible = false; } |
|
67 | 67 | void forceChartType(QChart::ChartType chartType) { m_chartType = chartType; } |
|
68 | 68 | |
|
69 | 69 | private: |
|
70 | 70 | QLineSeries *m_series; |
|
71 | 71 | QPainterPath m_linePath; |
|
72 | 72 | QPainterPath m_linePathPolarRight; |
|
73 | 73 | QPainterPath m_linePathPolarLeft; |
|
74 | 74 | QPainterPath m_fullPath; |
|
75 | 75 | QPainterPath m_shapePath; |
|
76 | 76 | |
|
77 | 77 | QVector<QPointF> m_points; |
|
78 | 78 | QRectF m_rect; |
|
79 | 79 | QPen m_linePen; |
|
80 | 80 | bool m_pointsVisible; |
|
81 | 81 | QChart::ChartType m_chartType; |
|
82 | 82 | |
|
83 | 83 | bool m_pointLabelsVisible; |
|
84 | 84 | QString m_pointLabelsFormat; |
|
85 | 85 | QFont m_pointLabelsFont; |
|
86 | 86 | QColor m_pointLabelsColor; |
|
87 | 87 | |
|
88 | 88 | QPointF m_lastMousePos; |
|
89 | 89 | bool m_mousePressed; |
|
90 | 90 | }; |
|
91 | 91 | |
|
92 | 92 | QT_CHARTS_END_NAMESPACE |
|
93 | 93 | |
|
94 | 94 | #endif |
@@ -1,49 +1,49 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QLINESERIES_P_H |
|
29 | 29 | #define QLINESERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qxyseries_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | class QLineSeriesPrivate: public QXYSeriesPrivate |
|
37 | 37 | { |
|
38 | 38 | public: |
|
39 | 39 | QLineSeriesPrivate(QLineSeries *q); |
|
40 | 40 | void initializeGraphics(QGraphicsItem* parent); |
|
41 | 41 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
42 | 42 | |
|
43 | 43 | private: |
|
44 | 44 | Q_DECLARE_PUBLIC(QLineSeries); |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | QT_CHARTS_END_NAMESPACE |
|
48 | 48 | |
|
49 | 49 | #endif |
@@ -1,87 +1,87 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef PIECHARTITEM_H |
|
29 | 29 | #define PIECHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QPieSeries> |
|
32 | 32 | #include <private/chartitem_p.h> |
|
33 | 33 | #include <private/piesliceitem_p.h> |
|
34 | 34 | #include <QtCore/QPointer> |
|
35 | 35 | |
|
36 | 36 | QT_BEGIN_NAMESPACE |
|
37 | 37 | class QGraphicsItem; |
|
38 | 38 | QT_END_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | QT_CHARTS_BEGIN_NAMESPACE |
|
41 | 41 | class QPieSlice; |
|
42 | 42 | class ChartPresenter; |
|
43 | 43 | class PieAnimation; |
|
44 | 44 | |
|
45 | 45 | class PieChartItem : public ChartItem |
|
46 | 46 | { |
|
47 | 47 | Q_OBJECT |
|
48 | 48 | |
|
49 | 49 | public: |
|
50 | 50 | explicit PieChartItem(QPieSeries *series, QGraphicsItem* item = 0); |
|
51 | 51 | ~PieChartItem(); |
|
52 | 52 | |
|
53 | 53 | // from QGraphicsItem |
|
54 | 54 | QRectF boundingRect() const { return m_rect; } |
|
55 | 55 | void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {} |
|
56 | 56 | |
|
57 | 57 | public Q_SLOTS: |
|
58 | 58 | // from Chart |
|
59 | 59 | virtual void handleDomainUpdated(); |
|
60 | 60 | |
|
61 | 61 | void updateLayout(); |
|
62 | 62 | void handleSlicesAdded(QList<QPieSlice *> slices); |
|
63 | 63 | void handleSlicesRemoved(QList<QPieSlice *> slices); |
|
64 | 64 | void handleSliceChanged(); |
|
65 | 65 | void handleSeriesVisibleChanged(); |
|
66 | 66 | void handleOpacityChanged(); |
|
67 | 67 | |
|
68 | 68 | void setAnimation(PieAnimation *animation); |
|
69 | 69 | ChartAnimation *animation() const; |
|
70 | 70 | |
|
71 | 71 | private: |
|
72 | 72 | PieSliceData updateSliceGeometry(QPieSlice *slice); |
|
73 | 73 | |
|
74 | 74 | private: |
|
75 | 75 | QHash<QPieSlice *, PieSliceItem *> m_sliceItems; |
|
76 | 76 | QPointer<QPieSeries> m_series; |
|
77 | 77 | QRectF m_rect; |
|
78 | 78 | QPointF m_pieCenter; |
|
79 | 79 | qreal m_pieRadius; |
|
80 | 80 | qreal m_holeSize; |
|
81 | 81 | PieAnimation *m_animation; |
|
82 | 82 | |
|
83 | 83 | }; |
|
84 | 84 | |
|
85 | 85 | QT_CHARTS_END_NAMESPACE |
|
86 | 86 | |
|
87 | 87 | #endif // PIECHARTITEM_H |
@@ -1,139 +1,139 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef PIESLICEDATA_P_H |
|
29 | 29 | #define PIESLICEDATA_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCharts/QPieSlice> |
|
33 | 33 | #include <QtGui/QPen> |
|
34 | 34 | #include <QtGui/QBrush> |
|
35 | 35 | |
|
36 | 36 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | template <class T> |
|
39 | 39 | class Themed : public T |
|
40 | 40 | { |
|
41 | 41 | public: |
|
42 | 42 | Themed(): m_isThemed(true) {} |
|
43 | 43 | |
|
44 | 44 | inline T &operator=(const T &other) { return T::operator =(other); } |
|
45 | 45 | |
|
46 | 46 | inline bool operator!=(const T &other) const { return T::operator !=(other); } |
|
47 | 47 | inline bool operator!=(const Themed &other) const |
|
48 | 48 | { |
|
49 | 49 | if (T::operator !=(other)) |
|
50 | 50 | return true; |
|
51 | 51 | |
|
52 | 52 | if (m_isThemed != other.m_isThemed) |
|
53 | 53 | return true; |
|
54 | 54 | |
|
55 | 55 | return false; |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | inline void setThemed(bool state) { m_isThemed = state; } |
|
59 | 59 | inline bool isThemed() const { return m_isThemed; } |
|
60 | 60 | |
|
61 | 61 | private: |
|
62 | 62 | bool m_isThemed; |
|
63 | 63 | }; |
|
64 | 64 | |
|
65 | 65 | class PieSliceData |
|
66 | 66 | { |
|
67 | 67 | public: |
|
68 | 68 | PieSliceData() : |
|
69 | 69 | m_value(0), |
|
70 | 70 | m_isExploded(false), |
|
71 | 71 | m_explodeDistanceFactor(0.15), |
|
72 | 72 | m_isLabelVisible(false), |
|
73 | 73 | m_labelPosition(QPieSlice::LabelOutside), |
|
74 | 74 | m_labelArmLengthFactor(0.15), |
|
75 | 75 | m_percentage(0), |
|
76 | 76 | m_radius(0), |
|
77 | 77 | m_startAngle(0), |
|
78 | 78 | m_angleSpan(0), |
|
79 | 79 | m_holeRadius(0) |
|
80 | 80 | { |
|
81 | 81 | } |
|
82 | 82 | |
|
83 | 83 | bool operator!=(const PieSliceData &other) const { |
|
84 | 84 | if (!qFuzzyIsNull(m_value - other.m_value)) |
|
85 | 85 | return true; |
|
86 | 86 | |
|
87 | 87 | if (m_slicePen != other.m_slicePen || |
|
88 | 88 | m_sliceBrush != other.m_sliceBrush) |
|
89 | 89 | return true; |
|
90 | 90 | |
|
91 | 91 | if (m_isExploded != other.m_isExploded || |
|
92 | 92 | !qFuzzyIsNull(m_explodeDistanceFactor - other.m_explodeDistanceFactor)) |
|
93 | 93 | return true; |
|
94 | 94 | |
|
95 | 95 | if (m_isLabelVisible != other.m_isLabelVisible || |
|
96 | 96 | m_labelText != other.m_labelText || |
|
97 | 97 | m_labelFont != other.m_labelFont || |
|
98 | 98 | m_labelPosition != other.m_labelPosition || |
|
99 | 99 | !qFuzzyIsNull(m_labelArmLengthFactor - other.m_labelArmLengthFactor) || |
|
100 | 100 | m_labelBrush != other.m_labelBrush) |
|
101 | 101 | return true; |
|
102 | 102 | |
|
103 | 103 | if (!qFuzzyIsNull(m_percentage - other.m_percentage) || |
|
104 | 104 | m_center != other.m_center || |
|
105 | 105 | !qFuzzyIsNull(m_radius - other.m_radius) || |
|
106 | 106 | !qFuzzyIsNull(m_startAngle - other.m_startAngle) || |
|
107 | 107 | !qFuzzyIsNull(m_angleSpan - other.m_angleSpan)) |
|
108 | 108 | return true; |
|
109 | 109 | |
|
110 | 110 | return false; |
|
111 | 111 | } |
|
112 | 112 | |
|
113 | 113 | qreal m_value; |
|
114 | 114 | |
|
115 | 115 | Themed<QPen> m_slicePen; |
|
116 | 116 | Themed<QBrush> m_sliceBrush; |
|
117 | 117 | |
|
118 | 118 | bool m_isExploded; |
|
119 | 119 | qreal m_explodeDistanceFactor; |
|
120 | 120 | |
|
121 | 121 | bool m_isLabelVisible; |
|
122 | 122 | QString m_labelText; |
|
123 | 123 | Themed<QFont> m_labelFont; |
|
124 | 124 | QPieSlice::LabelPosition m_labelPosition; |
|
125 | 125 | qreal m_labelArmLengthFactor; |
|
126 | 126 | Themed<QBrush> m_labelBrush; |
|
127 | 127 | |
|
128 | 128 | qreal m_percentage; |
|
129 | 129 | QPointF m_center; |
|
130 | 130 | qreal m_radius; |
|
131 | 131 | qreal m_startAngle; |
|
132 | 132 | qreal m_angleSpan; |
|
133 | 133 | |
|
134 | 134 | qreal m_holeRadius; |
|
135 | 135 | }; |
|
136 | 136 | |
|
137 | 137 | QT_CHARTS_END_NAMESPACE |
|
138 | 138 | |
|
139 | 139 | #endif // PIESLICEDATA_P_H |
@@ -1,96 +1,96 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef PIESLICEITEM_H |
|
29 | 29 | #define PIESLICEITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/charttheme_p.h> |
|
33 | 33 | #include <QtCharts/QPieSeries> |
|
34 | 34 | #include <private/pieslicedata_p.h> |
|
35 | 35 | #include <QtWidgets/QGraphicsItem> |
|
36 | 36 | #include <QtCore/QRectF> |
|
37 | 37 | #include <QtGui/QColor> |
|
38 | 38 | #include <QtGui/QPen> |
|
39 | 39 | |
|
40 | 40 | #define PIESLICE_LABEL_GAP 5 |
|
41 | 41 | |
|
42 | 42 | QT_CHARTS_BEGIN_NAMESPACE |
|
43 | 43 | class PieChartItem; |
|
44 | 44 | class PieSliceLabel; |
|
45 | 45 | class QPieSlice; |
|
46 | 46 | |
|
47 | 47 | class PieSliceItem : public QGraphicsObject |
|
48 | 48 | { |
|
49 | 49 | Q_OBJECT |
|
50 | 50 | |
|
51 | 51 | public: |
|
52 | 52 | PieSliceItem(QGraphicsItem *parent = 0); |
|
53 | 53 | ~PieSliceItem(); |
|
54 | 54 | |
|
55 | 55 | // from QGraphicsItem |
|
56 | 56 | QRectF boundingRect() const; |
|
57 | 57 | QPainterPath shape() const; |
|
58 | 58 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
59 | 59 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
60 | 60 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
61 | 61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
62 | 62 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
63 | 63 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
64 | 64 | |
|
65 | 65 | void setLayout(const PieSliceData &sliceData); |
|
66 | 66 | static QPointF sliceCenter(QPointF point, qreal radius, QPieSlice *slice); |
|
67 | 67 | |
|
68 | 68 | Q_SIGNALS: |
|
69 | 69 | void clicked(Qt::MouseButtons buttons); |
|
70 | 70 | void hovered(bool state); |
|
71 | 71 | void pressed(Qt::MouseButtons buttons); |
|
72 | 72 | void released(Qt::MouseButtons buttons); |
|
73 | 73 | void doubleClicked(Qt::MouseButtons buttons); |
|
74 | 74 | |
|
75 | 75 | private: |
|
76 | 76 | void updateGeometry(); |
|
77 | 77 | QPainterPath slicePath(QPointF center, qreal radius, qreal startAngle, qreal angleSpan, qreal *centerAngle, QPointF *armStart); |
|
78 | 78 | QPainterPath labelArmPath(QPointF start, qreal angle, qreal length, qreal textWidth, QPointF *textStart); |
|
79 | 79 | |
|
80 | 80 | private: |
|
81 | 81 | PieSliceData m_data; |
|
82 | 82 | QRectF m_boundingRect; |
|
83 | 83 | QPainterPath m_slicePath; |
|
84 | 84 | QPainterPath m_labelArmPath; |
|
85 | 85 | QRectF m_labelTextRect; |
|
86 | 86 | bool m_hovered; |
|
87 | 87 | QGraphicsTextItem *m_labelItem; |
|
88 | 88 | |
|
89 | 89 | bool m_mousePressed; |
|
90 | 90 | |
|
91 | 91 | friend class PieSliceAnimation; |
|
92 | 92 | }; |
|
93 | 93 | |
|
94 | 94 | QT_CHARTS_END_NAMESPACE |
|
95 | 95 | |
|
96 | 96 | #endif // PIESLICEITEM_H |
@@ -1,99 +1,99 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QPIEMODELMAPPER_P_H |
|
29 | 29 | #define QPIEMODELMAPPER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCore/QObject> |
|
32 | 32 | #include <QtCharts/QPieModelMapper> |
|
33 | 33 | |
|
34 | 34 | QT_BEGIN_NAMESPACE |
|
35 | 35 | class QModelIndex; |
|
36 | 36 | QT_END_NAMESPACE |
|
37 | 37 | |
|
38 | 38 | QT_CHARTS_BEGIN_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | class QPieSlice; |
|
41 | 41 | |
|
42 | 42 | class QPieModelMapperPrivate : public QObject |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | |
|
46 | 46 | public: |
|
47 | 47 | explicit QPieModelMapperPrivate(QPieModelMapper *q); |
|
48 | 48 | |
|
49 | 49 | public Q_SLOTS: |
|
50 | 50 | // for the model |
|
51 | 51 | void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); |
|
52 | 52 | void modelRowsAdded(QModelIndex parent, int start, int end); |
|
53 | 53 | void modelRowsRemoved(QModelIndex parent, int start, int end); |
|
54 | 54 | void modelColumnsAdded(QModelIndex parent, int start, int end); |
|
55 | 55 | void modelColumnsRemoved(QModelIndex parent, int start, int end); |
|
56 | 56 | void handleModelDestroyed(); |
|
57 | 57 | |
|
58 | 58 | // for the series |
|
59 | 59 | void slicesAdded(QList<QPieSlice *> slices); |
|
60 | 60 | void slicesRemoved(QList<QPieSlice *> slices); |
|
61 | 61 | void sliceLabelChanged(); |
|
62 | 62 | void sliceValueChanged(); |
|
63 | 63 | void handleSeriesDestroyed(); |
|
64 | 64 | |
|
65 | 65 | void initializePieFromModel(); |
|
66 | 66 | |
|
67 | 67 | private: |
|
68 | 68 | QPieSlice *pieSlice(QModelIndex index) const; |
|
69 | 69 | bool isLabelIndex(QModelIndex index) const; |
|
70 | 70 | bool isValueIndex(QModelIndex index) const; |
|
71 | 71 | QModelIndex valueModelIndex(int slicePos); |
|
72 | 72 | QModelIndex labelModelIndex(int slicePos); |
|
73 | 73 | void insertData(int start, int end); |
|
74 | 74 | void removeData(int start, int end); |
|
75 | 75 | |
|
76 | 76 | void blockModelSignals(bool block = true); |
|
77 | 77 | void blockSeriesSignals(bool block = true); |
|
78 | 78 | |
|
79 | 79 | private: |
|
80 | 80 | QPieSeries *m_series; |
|
81 | 81 | QList<QPieSlice *> m_slices; |
|
82 | 82 | QAbstractItemModel *m_model; |
|
83 | 83 | int m_first; |
|
84 | 84 | int m_count; |
|
85 | 85 | Qt::Orientation m_orientation; |
|
86 | 86 | int m_valuesSection; |
|
87 | 87 | int m_labelsSection; |
|
88 | 88 | bool m_seriesSignalsBlock; |
|
89 | 89 | bool m_modelSignalsBlock; |
|
90 | 90 | |
|
91 | 91 | private: |
|
92 | 92 | |
|
93 | 93 | QPieModelMapper *q_ptr; |
|
94 | 94 | Q_DECLARE_PUBLIC(QPieModelMapper) |
|
95 | 95 | }; |
|
96 | 96 | |
|
97 | 97 | QT_CHARTS_END_NAMESPACE |
|
98 | 98 | |
|
99 | 99 | #endif // QPIEMODELMAPPER_P_H |
@@ -1,95 +1,95 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QPIESERIES_P_H |
|
29 | 29 | #define QPIESERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QPieSeries> |
|
32 | 32 | #include <private/qabstractseries_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | class QLegendPrivate; |
|
36 | 36 | |
|
37 | 37 | class QPieSeriesPrivate : public QAbstractSeriesPrivate |
|
38 | 38 | { |
|
39 | 39 | Q_OBJECT |
|
40 | 40 | |
|
41 | 41 | public: |
|
42 | 42 | QPieSeriesPrivate(QPieSeries *parent); |
|
43 | 43 | ~QPieSeriesPrivate(); |
|
44 | 44 | |
|
45 | 45 | void initializeDomain(); |
|
46 | 46 | void initializeAxes(); |
|
47 | 47 | void initializeGraphics(QGraphicsItem* parent); |
|
48 | 48 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, |
|
49 | 49 | QEasingCurve &curve); |
|
50 | 50 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
51 | 51 | |
|
52 | 52 | QList<QLegendMarker *> createLegendMarkers(QLegend *legend); |
|
53 | 53 | |
|
54 | 54 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
55 | 55 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const; |
|
56 | 56 | |
|
57 | 57 | void updateDerivativeData(); |
|
58 | 58 | void setSizes(qreal innerSize, qreal outerSize); |
|
59 | 59 | |
|
60 | 60 | static QPieSeriesPrivate *fromSeries(QPieSeries *series); |
|
61 | 61 | |
|
62 | 62 | Q_SIGNALS: |
|
63 | 63 | void calculatedDataChanged(); |
|
64 | 64 | void pieSizeChanged(); |
|
65 | 65 | void pieStartAngleChanged(); |
|
66 | 66 | void pieEndAngleChanged(); |
|
67 | 67 | void horizontalPositionChanged(); |
|
68 | 68 | void verticalPositionChanged(); |
|
69 | 69 | |
|
70 | 70 | public Q_SLOTS: |
|
71 | 71 | void sliceValueChanged(); |
|
72 | 72 | void sliceClicked(); |
|
73 | 73 | void sliceHovered(bool state); |
|
74 | 74 | void slicePressed(); |
|
75 | 75 | void sliceReleased(); |
|
76 | 76 | void sliceDoubleClicked(); |
|
77 | 77 | |
|
78 | 78 | private: |
|
79 | 79 | QList<QPieSlice *> m_slices; |
|
80 | 80 | qreal m_pieRelativeHorPos; |
|
81 | 81 | qreal m_pieRelativeVerPos; |
|
82 | 82 | qreal m_pieRelativeSize; |
|
83 | 83 | qreal m_pieStartAngle; |
|
84 | 84 | qreal m_pieEndAngle; |
|
85 | 85 | qreal m_sum; |
|
86 | 86 | qreal m_holeRelativeSize; |
|
87 | 87 | |
|
88 | 88 | public: |
|
89 | 89 | friend class QLegendPrivate; |
|
90 | 90 | Q_DECLARE_PUBLIC(QPieSeries) |
|
91 | 91 | }; |
|
92 | 92 | |
|
93 | 93 | QT_CHARTS_END_NAMESPACE |
|
94 | 94 | |
|
95 | 95 | #endif // QPIESERIES_P_H |
@@ -1,78 +1,78 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QPIESLICE_P_H |
|
29 | 29 | #define QPIESLICE_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCore/QObject> |
|
32 | 32 | #include <QtCharts/QPieSlice> |
|
33 | 33 | #include <private/pieslicedata_p.h> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | class QPieSeries; |
|
37 | 37 | |
|
38 | 38 | class QPieSlicePrivate : public QObject |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | QPieSlicePrivate(QPieSlice *parent); |
|
44 | 44 | ~QPieSlicePrivate(); |
|
45 | 45 | |
|
46 | 46 | static QPieSlicePrivate *fromSlice(QPieSlice *slice); |
|
47 | 47 | |
|
48 | 48 | void setPen(const QPen &pen, bool themed); |
|
49 | 49 | void setBrush(const QBrush &brush, bool themed); |
|
50 | 50 | void setLabelBrush(const QBrush &brush, bool themed); |
|
51 | 51 | void setLabelFont(const QFont &font, bool themed); |
|
52 | 52 | |
|
53 | 53 | void setPercentage(qreal percentage); |
|
54 | 54 | void setStartAngle(qreal angle); |
|
55 | 55 | void setAngleSpan(qreal span); |
|
56 | 56 | |
|
57 | 57 | Q_SIGNALS: |
|
58 | 58 | void labelPositionChanged(); |
|
59 | 59 | void explodedChanged(); |
|
60 | 60 | void labelArmLengthFactorChanged(); |
|
61 | 61 | void explodeDistanceFactorChanged(); |
|
62 | 62 | |
|
63 | 63 | private: |
|
64 | 64 | friend class QPieSeries; |
|
65 | 65 | friend class QPieSeriesPrivate; |
|
66 | 66 | friend class ChartThemeManager; |
|
67 | 67 | friend class PieChartItem; |
|
68 | 68 | |
|
69 | 69 | QPieSlice * const q_ptr; |
|
70 | 70 | Q_DECLARE_PUBLIC(QPieSlice) |
|
71 | 71 | |
|
72 | 72 | PieSliceData m_data; |
|
73 | 73 | QPieSeries *m_series; |
|
74 | 74 | }; |
|
75 | 75 | |
|
76 | 76 | QT_CHARTS_END_NAMESPACE |
|
77 | 77 | |
|
78 | 78 | #endif // QPIESLICE_P_H |
@@ -1,109 +1,109 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QABSTRACTSERIES_P_H |
|
29 | 29 | #define QABSTRACTSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QAbstractSeries> |
|
32 | 32 | #include <QtCharts/QChart> |
|
33 | 33 | #include <private/abstractdomain_p.h> |
|
34 | 34 | |
|
35 | 35 | QT_BEGIN_NAMESPACE |
|
36 | 36 | class QGraphicsItem; |
|
37 | 37 | QT_END_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | QT_CHARTS_BEGIN_NAMESPACE |
|
40 | 40 | |
|
41 | 41 | class ChartPresenter; |
|
42 | 42 | class ChartElement; |
|
43 | 43 | class LegendMarker; |
|
44 | 44 | class QLegend; |
|
45 | 45 | class ChartDataSet; |
|
46 | 46 | class QAbstractAxis; |
|
47 | 47 | class QLegendMarker; |
|
48 | 48 | class ChartTheme; |
|
49 | 49 | class ChartAnimation; |
|
50 | 50 | class ChartItem; |
|
51 | 51 | class BoxPlotChartItem; |
|
52 | 52 | |
|
53 | 53 | class QAbstractSeriesPrivate : public QObject |
|
54 | 54 | { |
|
55 | 55 | Q_OBJECT |
|
56 | 56 | public: |
|
57 | 57 | QAbstractSeriesPrivate(QAbstractSeries *q); |
|
58 | 58 | ~QAbstractSeriesPrivate(); |
|
59 | 59 | |
|
60 | 60 | virtual void initializeDomain() = 0; |
|
61 | 61 | virtual void initializeAxes() = 0; |
|
62 | 62 | virtual void initializeTheme(int index, ChartTheme* theme, bool forced = false) = 0; |
|
63 | 63 | virtual void initializeGraphics(QGraphicsItem* parent) = 0; |
|
64 | 64 | virtual void initializeAnimations(QChart::AnimationOptions options, int duration, |
|
65 | 65 | QEasingCurve &curve) = 0; |
|
66 | 66 | |
|
67 | 67 | virtual QList<QLegendMarker*> createLegendMarkers(QLegend* legend) = 0; |
|
68 | 68 | |
|
69 | 69 | virtual QAbstractAxis::AxisType defaultAxisType(Qt::Orientation) const = 0; |
|
70 | 70 | virtual QAbstractAxis* createDefaultAxis(Qt::Orientation) const = 0; |
|
71 | 71 | |
|
72 | 72 | ChartItem* chartItem() { return m_item.data(); } |
|
73 | 73 | |
|
74 | 74 | virtual void setDomain(AbstractDomain* domain); |
|
75 | 75 | AbstractDomain* domain() { return m_domain.data(); } |
|
76 | 76 | |
|
77 | 77 | virtual void setPresenter(ChartPresenter *presenter); |
|
78 | 78 | ChartPresenter *presenter() const; |
|
79 | 79 | |
|
80 | 80 | QChart* chart() { return m_chart; } |
|
81 | 81 | bool reverseXAxis(); |
|
82 | 82 | bool reverseYAxis(); |
|
83 | 83 | |
|
84 | 84 | Q_SIGNALS: |
|
85 | 85 | void countChanged(); |
|
86 | 86 | |
|
87 | 87 | protected: |
|
88 | 88 | QAbstractSeries *q_ptr; |
|
89 | 89 | QChart *m_chart; |
|
90 | 90 | QScopedPointer<ChartItem> m_item; |
|
91 | 91 | QList<QAbstractAxis*> m_axes; |
|
92 | 92 | |
|
93 | 93 | private: |
|
94 | 94 | QScopedPointer<AbstractDomain> m_domain; |
|
95 | 95 | QString m_name; |
|
96 | 96 | bool m_visible; |
|
97 | 97 | qreal m_opacity; |
|
98 | 98 | ChartPresenter *m_presenter; |
|
99 | 99 | |
|
100 | 100 | friend class QAbstractSeries; |
|
101 | 101 | friend class ChartDataSet; |
|
102 | 102 | friend class ChartPresenter; |
|
103 | 103 | friend class QLegendPrivate; |
|
104 | 104 | friend class BoxPlotChartItem; |
|
105 | 105 | }; |
|
106 | 106 | |
|
107 | 107 | QT_CHARTS_END_NAMESPACE |
|
108 | 108 | |
|
109 | 109 | #endif |
@@ -1,68 +1,68 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QCHART_P_H |
|
29 | 29 | #define QCHART_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCharts/QChart> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class ChartThemeManager; |
|
37 | 37 | class ChartPresenter; |
|
38 | 38 | class QLegend; |
|
39 | 39 | class ChartDataSet; |
|
40 | 40 | |
|
41 | 41 | class QChartPrivate |
|
42 | 42 | { |
|
43 | 43 | |
|
44 | 44 | public: |
|
45 | 45 | QChartPrivate(QChart *q, QChart::ChartType type); |
|
46 | 46 | ~QChartPrivate(); |
|
47 | 47 | QChart *q_ptr; |
|
48 | 48 | QLegend *m_legend; |
|
49 | 49 | ChartDataSet *m_dataset; |
|
50 | 50 | ChartPresenter *m_presenter; |
|
51 | 51 | ChartThemeManager *m_themeManager; |
|
52 | 52 | QChart::ChartType m_type; |
|
53 | 53 | |
|
54 | 54 | static QPen &defaultPen(); |
|
55 | 55 | static QBrush &defaultBrush(); |
|
56 | 56 | static QFont &defaultFont(); |
|
57 | 57 | |
|
58 | 58 | void init(); |
|
59 | 59 | void zoomIn(qreal factor); |
|
60 | 60 | void zoomOut(qreal factor); |
|
61 | 61 | void zoomIn(const QRectF &rect); |
|
62 | 62 | void zoomReset(); |
|
63 | 63 | bool isZoomed(); |
|
64 | 64 | void scroll(qreal dx, qreal dy); |
|
65 | 65 | }; |
|
66 | 66 | |
|
67 | 67 | QT_CHARTS_END_NAMESPACE |
|
68 | 68 | #endif |
@@ -1,65 +1,65 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QCHARTVIEW_P_H |
|
29 | 29 | #define QCHARTVIEW_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartView> |
|
32 | 32 | |
|
33 | 33 | QT_BEGIN_NAMESPACE |
|
34 | 34 | class QGraphicsScene; |
|
35 | 35 | QT_END_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QChart; |
|
40 | 40 | class ChartPresenter; |
|
41 | 41 | class QChartView; |
|
42 | 42 | |
|
43 | 43 | class QChartViewPrivate |
|
44 | 44 | { |
|
45 | 45 | public: |
|
46 | 46 | explicit QChartViewPrivate(QChartView *q, QChart *chart = 0); |
|
47 | 47 | ~QChartViewPrivate(); |
|
48 | 48 | void setChart(QChart *chart); |
|
49 | 49 | void resize(); |
|
50 | 50 | |
|
51 | 51 | protected: |
|
52 | 52 | QChartView *q_ptr; |
|
53 | 53 | |
|
54 | 54 | public: |
|
55 | 55 | QGraphicsScene *m_scene; |
|
56 | 56 | QChart *m_chart; |
|
57 | 57 | QPoint m_rubberBandOrigin; |
|
58 | 58 | #ifndef QT_NO_RUBBERBAND |
|
59 | 59 | QRubberBand *m_rubberBand; |
|
60 | 60 | #endif |
|
61 | 61 | QChartView::RubberBands m_rubberBandFlags; |
|
62 | 62 | }; |
|
63 | 63 | |
|
64 | 64 | QT_CHARTS_END_NAMESPACE |
|
65 | 65 | #endif |
@@ -1,52 +1,52 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QSCATTERSERIES_P_H |
|
29 | 29 | #define QSCATTERSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qxyseries_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QScatterSeriesPrivate: public QXYSeriesPrivate |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | QScatterSeriesPrivate(QScatterSeries *q); |
|
39 | 39 | void initializeGraphics(QGraphicsItem* parent); |
|
40 | 40 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
41 | 41 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, |
|
42 | 42 | QEasingCurve &curve); |
|
43 | 43 | |
|
44 | 44 | private: |
|
45 | 45 | QScatterSeries::MarkerShape m_shape; |
|
46 | 46 | qreal m_size; |
|
47 | 47 | Q_DECLARE_PUBLIC(QScatterSeries) |
|
48 | 48 | }; |
|
49 | 49 | |
|
50 | 50 | QT_CHARTS_END_NAMESPACE |
|
51 | 51 | |
|
52 | 52 | #endif |
@@ -1,189 +1,189 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef SCATTERCHARTITEM_H |
|
29 | 29 | #define SCATTERCHARTITEM_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/xychart_p.h> |
|
33 | 33 | #include <QtWidgets/QGraphicsEllipseItem> |
|
34 | 34 | #include <QtGui/QPen> |
|
35 | 35 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class QScatterSeries; |
|
40 | 40 | |
|
41 | 41 | class ScatterChartItem : public XYChart |
|
42 | 42 | { |
|
43 | 43 | Q_OBJECT |
|
44 | 44 | Q_INTERFACES(QGraphicsItem) |
|
45 | 45 | public: |
|
46 | 46 | explicit ScatterChartItem(QScatterSeries *series, QGraphicsItem *item = 0); |
|
47 | 47 | |
|
48 | 48 | public: |
|
49 | 49 | //from QGraphicsItem |
|
50 | 50 | QRectF boundingRect() const; |
|
51 | 51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
52 | 52 | |
|
53 | 53 | void setPen(const QPen &pen); |
|
54 | 54 | void setBrush(const QBrush &brush); |
|
55 | 55 | |
|
56 | 56 | void markerSelected(QGraphicsItem *item); |
|
57 | 57 | void markerHovered(QGraphicsItem *item, bool state); |
|
58 | 58 | void markerPressed(QGraphicsItem *item); |
|
59 | 59 | void markerReleased(QGraphicsItem *item); |
|
60 | 60 | void markerDoubleClicked(QGraphicsItem *item); |
|
61 | 61 | |
|
62 | 62 | void setMousePressed(bool pressed = true) {m_mousePressed = pressed;} |
|
63 | 63 | bool mousePressed() {return m_mousePressed;} |
|
64 | 64 | |
|
65 | 65 | |
|
66 | 66 | public Q_SLOTS: |
|
67 | 67 | void handleUpdated(); |
|
68 | 68 | |
|
69 | 69 | private: |
|
70 | 70 | void createPoints(int count); |
|
71 | 71 | void deletePoints(int count); |
|
72 | 72 | |
|
73 | 73 | protected: |
|
74 | 74 | void updateGeometry(); |
|
75 | 75 | |
|
76 | 76 | private: |
|
77 | 77 | QScatterSeries *m_series; |
|
78 | 78 | QGraphicsItemGroup m_items; |
|
79 | 79 | bool m_visible; |
|
80 | 80 | int m_shape; |
|
81 | 81 | int m_size; |
|
82 | 82 | QRectF m_rect; |
|
83 | 83 | QMap<QGraphicsItem *, QPointF> m_markerMap; |
|
84 | 84 | |
|
85 | 85 | bool m_pointLabelsVisible; |
|
86 | 86 | QString m_pointLabelsFormat; |
|
87 | 87 | QFont m_pointLabelsFont; |
|
88 | 88 | QColor m_pointLabelsColor; |
|
89 | 89 | |
|
90 | 90 | bool m_mousePressed; |
|
91 | 91 | }; |
|
92 | 92 | |
|
93 | 93 | class CircleMarker: public QGraphicsEllipseItem |
|
94 | 94 | { |
|
95 | 95 | |
|
96 | 96 | public: |
|
97 | 97 | CircleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) |
|
98 | 98 | : QGraphicsEllipseItem(x, y, w, h, parent), |
|
99 | 99 | m_parent(parent) |
|
100 | 100 | { |
|
101 | 101 | setAcceptHoverEvents(true); |
|
102 | 102 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
103 | 103 | } |
|
104 | 104 | |
|
105 | 105 | protected: |
|
106 | 106 | void mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
107 | 107 | { |
|
108 | 108 | QGraphicsEllipseItem::mousePressEvent(event); |
|
109 | 109 | m_parent->markerPressed(this); |
|
110 | 110 | m_parent->setMousePressed(); |
|
111 | 111 | } |
|
112 | 112 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
113 | 113 | { |
|
114 | 114 | QGraphicsEllipseItem::hoverEnterEvent(event); |
|
115 | 115 | m_parent->markerHovered(this, true); |
|
116 | 116 | } |
|
117 | 117 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
118 | 118 | { |
|
119 | 119 | QGraphicsEllipseItem::hoverLeaveEvent(event); |
|
120 | 120 | m_parent->markerHovered(this, false); |
|
121 | 121 | } |
|
122 | 122 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
123 | 123 | { |
|
124 | 124 | QGraphicsEllipseItem::mouseReleaseEvent(event); |
|
125 | 125 | m_parent->markerReleased(this); |
|
126 | 126 | if (m_parent->mousePressed()) |
|
127 | 127 | m_parent->markerSelected(this); |
|
128 | 128 | m_parent->setMousePressed(false); |
|
129 | 129 | } |
|
130 | 130 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
131 | 131 | { |
|
132 | 132 | QGraphicsEllipseItem::mouseDoubleClickEvent(event); |
|
133 | 133 | m_parent->markerDoubleClicked(this); |
|
134 | 134 | } |
|
135 | 135 | |
|
136 | 136 | private: |
|
137 | 137 | ScatterChartItem *m_parent; |
|
138 | 138 | }; |
|
139 | 139 | |
|
140 | 140 | class RectangleMarker: public QGraphicsRectItem |
|
141 | 141 | { |
|
142 | 142 | |
|
143 | 143 | public: |
|
144 | 144 | RectangleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) |
|
145 | 145 | : QGraphicsRectItem(x, y, w, h, parent), |
|
146 | 146 | m_parent(parent) |
|
147 | 147 | { |
|
148 | 148 | setAcceptHoverEvents(true); |
|
149 | 149 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
150 | 150 | } |
|
151 | 151 | |
|
152 | 152 | protected: |
|
153 | 153 | void mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
154 | 154 | { |
|
155 | 155 | QGraphicsRectItem::mousePressEvent(event); |
|
156 | 156 | m_parent->markerPressed(this); |
|
157 | 157 | m_parent->setMousePressed(); |
|
158 | 158 | } |
|
159 | 159 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
160 | 160 | { |
|
161 | 161 | QGraphicsRectItem::hoverEnterEvent(event); |
|
162 | 162 | m_parent->markerHovered(this, true); |
|
163 | 163 | } |
|
164 | 164 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
165 | 165 | { |
|
166 | 166 | QGraphicsRectItem::hoverLeaveEvent(event); |
|
167 | 167 | m_parent->markerHovered(this, false); |
|
168 | 168 | } |
|
169 | 169 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
170 | 170 | { |
|
171 | 171 | QGraphicsRectItem::mouseReleaseEvent(event); |
|
172 | 172 | m_parent->markerReleased(this); |
|
173 | 173 | if (m_parent->mousePressed()) |
|
174 | 174 | m_parent->markerSelected(this); |
|
175 | 175 | m_parent->setMousePressed(false); |
|
176 | 176 | } |
|
177 | 177 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
178 | 178 | { |
|
179 | 179 | QGraphicsRectItem::mouseDoubleClickEvent(event); |
|
180 | 180 | m_parent->markerDoubleClicked(this); |
|
181 | 181 | } |
|
182 | 182 | |
|
183 | 183 | private: |
|
184 | 184 | ScatterChartItem *m_parent; |
|
185 | 185 | }; |
|
186 | 186 | |
|
187 | 187 | QT_CHARTS_END_NAMESPACE |
|
188 | 188 | |
|
189 | 189 | #endif // SCATTERPRESENTER_H |
@@ -1,110 +1,110 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef SCROLLER_P_H |
|
29 | 29 | #define SCROLLER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <QtCore/QObject> |
|
33 | 33 | #include <QtCore/QBasicTimer> |
|
34 | 34 | #include <QtCore/QTime> |
|
35 | 35 | #include <QtCore/QPointF> |
|
36 | 36 | |
|
37 | 37 | QT_BEGIN_NAMESPACE |
|
38 | 38 | class QGraphicsSceneMouseEvent; |
|
39 | 39 | QT_END_NAMESPACE |
|
40 | 40 | |
|
41 | 41 | QT_CHARTS_BEGIN_NAMESPACE |
|
42 | 42 | |
|
43 | 43 | class Scroller; |
|
44 | 44 | class QLegend; |
|
45 | 45 | |
|
46 | 46 | class ScrollTicker : public QObject |
|
47 | 47 | { |
|
48 | 48 | Q_OBJECT |
|
49 | 49 | public: |
|
50 | 50 | explicit ScrollTicker(Scroller *scroller, QObject *parent = 0); |
|
51 | 51 | void start(int interval); |
|
52 | 52 | void stop(); |
|
53 | 53 | protected: |
|
54 | 54 | void timerEvent(QTimerEvent *event); |
|
55 | 55 | |
|
56 | 56 | private: |
|
57 | 57 | QBasicTimer m_timer; |
|
58 | 58 | Scroller *m_scroller; |
|
59 | 59 | }; |
|
60 | 60 | |
|
61 | 61 | class Scroller |
|
62 | 62 | { |
|
63 | 63 | public: |
|
64 | 64 | enum State { |
|
65 | 65 | Idle, |
|
66 | 66 | Pressed, |
|
67 | 67 | Move, |
|
68 | 68 | Scroll |
|
69 | 69 | }; |
|
70 | 70 | |
|
71 | 71 | Scroller(); |
|
72 | 72 | virtual ~Scroller(); |
|
73 | 73 | |
|
74 | 74 | virtual void setOffset(const QPointF &point) = 0; |
|
75 | 75 | virtual QPointF offset() const = 0; |
|
76 | 76 | |
|
77 | 77 | void move(const QPointF &delta); |
|
78 | 78 | void scrollTo(const QPointF &delta); |
|
79 | 79 | |
|
80 | 80 | void handleMousePressEvent(QGraphicsSceneMouseEvent *event); |
|
81 | 81 | void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
82 | 82 | void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
83 | 83 | |
|
84 | 84 | void scrollTick(); |
|
85 | 85 | |
|
86 | 86 | private: |
|
87 | 87 | void startTicker(int interval); |
|
88 | 88 | void stopTicker(); |
|
89 | 89 | |
|
90 | 90 | private: |
|
91 | 91 | void calculateSpeed(const QPointF &position); |
|
92 | 92 | void lowerSpeed(QPointF &speed, qreal maxSpeed = 100); |
|
93 | 93 | |
|
94 | 94 | private: |
|
95 | 95 | ScrollTicker m_ticker; |
|
96 | 96 | QTime m_timeStamp; |
|
97 | 97 | QPointF m_speed; |
|
98 | 98 | QPointF m_fraction; |
|
99 | 99 | int m_timeTresholdMin; |
|
100 | 100 | int m_timeTresholdMax; |
|
101 | 101 | |
|
102 | 102 | State m_state; |
|
103 | 103 | QPointF m_pressPos; |
|
104 | 104 | QPointF m_lastPos; |
|
105 | 105 | qreal m_treshold; |
|
106 | 106 | }; |
|
107 | 107 | |
|
108 | 108 | QT_CHARTS_END_NAMESPACE |
|
109 | 109 | |
|
110 | 110 | #endif /* SCROLLER_P_H */ |
@@ -1,53 +1,53 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QSPLINESERIES_P_H |
|
29 | 29 | #define QSPLINESERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qlineseries_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | class QSplineSeriesPrivate: public QLineSeriesPrivate |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | public: |
|
40 | 40 | QSplineSeriesPrivate(QSplineSeries *q); |
|
41 | 41 | |
|
42 | 42 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
43 | 43 | void initializeGraphics(QGraphicsItem* parent); |
|
44 | 44 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, |
|
45 | 45 | QEasingCurve &curve); |
|
46 | 46 | |
|
47 | 47 | private: |
|
48 | 48 | Q_DECLARE_PUBLIC(QSplineSeries) |
|
49 | 49 | }; |
|
50 | 50 | |
|
51 | 51 | QT_CHARTS_END_NAMESPACE |
|
52 | 52 | |
|
53 | 53 | #endif |
@@ -1,97 +1,97 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef SPLINECHARTITEM_P_H |
|
29 | 29 | #define SPLINECHARTITEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QSplineSeries> |
|
32 | 32 | #include <private/xychart_p.h> |
|
33 | 33 | |
|
34 | 34 | QT_CHARTS_BEGIN_NAMESPACE |
|
35 | 35 | |
|
36 | 36 | class SplineAnimation; |
|
37 | 37 | |
|
38 | 38 | class SplineChartItem : public XYChart |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | Q_INTERFACES(QGraphicsItem) |
|
42 | 42 | public: |
|
43 | 43 | SplineChartItem(QSplineSeries *series, QGraphicsItem *item = 0); |
|
44 | 44 | |
|
45 | 45 | //from QGraphicsItem |
|
46 | 46 | QRectF boundingRect() const; |
|
47 | 47 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
48 | 48 | QPainterPath shape() const; |
|
49 | 49 | |
|
50 | 50 | void setControlGeometryPoints(QVector<QPointF>& points); |
|
51 | 51 | QVector<QPointF> controlGeometryPoints() const; |
|
52 | 52 | |
|
53 | 53 | void setAnimation(SplineAnimation *animation); |
|
54 | 54 | ChartAnimation *animation() const; |
|
55 | 55 | |
|
56 | 56 | public Q_SLOTS: |
|
57 | 57 | void handleUpdated(); |
|
58 | 58 | |
|
59 | 59 | protected: |
|
60 | 60 | void updateGeometry(); |
|
61 | 61 | QVector<QPointF> calculateControlPoints(const QVector<QPointF> &points); |
|
62 | 62 | QVector<qreal> firstControlPoints(const QVector<qreal>& vector); |
|
63 | 63 | void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index); |
|
64 | 64 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
65 | 65 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
66 | 66 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
67 | 67 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
68 | 68 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
69 | 69 | |
|
70 | 70 | private: |
|
71 | 71 | QSplineSeries *m_series; |
|
72 | 72 | QPainterPath m_path; |
|
73 | 73 | QPainterPath m_pathPolarRight; |
|
74 | 74 | QPainterPath m_pathPolarLeft; |
|
75 | 75 | QPainterPath m_fullPath; |
|
76 | 76 | QRectF m_rect; |
|
77 | 77 | QPen m_linePen; |
|
78 | 78 | QPen m_pointPen; |
|
79 | 79 | bool m_pointsVisible; |
|
80 | 80 | QVector<QPointF> m_controlPoints; |
|
81 | 81 | QVector<QPointF> m_visiblePoints; |
|
82 | 82 | SplineAnimation *m_animation; |
|
83 | 83 | |
|
84 | 84 | bool m_pointLabelsVisible; |
|
85 | 85 | QString m_pointLabelsFormat; |
|
86 | 86 | QFont m_pointLabelsFont; |
|
87 | 87 | QColor m_pointLabelsColor; |
|
88 | 88 | |
|
89 | 89 | QPointF m_lastMousePos; |
|
90 | 90 | bool m_mousePressed; |
|
91 | 91 | |
|
92 | 92 | friend class SplineAnimation; |
|
93 | 93 | }; |
|
94 | 94 | |
|
95 | 95 | QT_CHARTS_END_NAMESPACE |
|
96 | 96 | |
|
97 | 97 | #endif // SPLINECHARTITEM_P_H |
@@ -1,93 +1,93 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEME_H |
|
29 | 29 | #define CHARTTHEME_H |
|
30 | 30 | |
|
31 | 31 | #include <private/chartthememanager_p.h> |
|
32 | 32 | #include <QtGui/QColor> |
|
33 | 33 | #include <QtGui/QGradientStops> |
|
34 | 34 | |
|
35 | 35 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | 36 | |
|
37 | 37 | class ChartTheme |
|
38 | 38 | { |
|
39 | 39 | |
|
40 | 40 | public: |
|
41 | 41 | enum BackgroundShadesMode { |
|
42 | 42 | BackgroundShadesNone = 0, |
|
43 | 43 | BackgroundShadesVertical, |
|
44 | 44 | BackgroundShadesHorizontal, |
|
45 | 45 | BackgroundShadesBoth |
|
46 | 46 | }; |
|
47 | 47 | |
|
48 | 48 | protected: |
|
49 | 49 | explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeLight):m_id(id), |
|
50 | 50 | m_backgroundShadesBrush(Qt::SolidPattern), |
|
51 | 51 | m_backgroundShades(BackgroundShadesNone), |
|
52 | 52 | m_backgroundDropShadowEnabled(false) |
|
53 | 53 | {}; |
|
54 | 54 | public: |
|
55 | 55 | QChart::ChartTheme id() const { return m_id; } |
|
56 | 56 | QList<QGradient> seriesGradients() const { return m_seriesGradients; } |
|
57 | 57 | QList<QColor> seriesColors() const { return m_seriesColors; } |
|
58 | 58 | QLinearGradient chartBackgroundGradient() const { return m_chartBackgroundGradient; } |
|
59 | 59 | QFont masterFont() const { return m_masterFont; } |
|
60 | 60 | QFont labelFont() const { return m_labelFont; } |
|
61 | 61 | QBrush labelBrush() const { return m_labelBrush; } |
|
62 | 62 | QPen axisLinePen() const { return m_axisLinePen; } |
|
63 | 63 | QPen backgroundShadesPen() const { return m_backgroundShadesPen; } |
|
64 | 64 | QPen outlinePen() const { return m_outlinePen; } |
|
65 | 65 | QBrush backgroundShadesBrush() const { return m_backgroundShadesBrush; } |
|
66 | 66 | BackgroundShadesMode backgroundShades() const { return m_backgroundShades; } |
|
67 | 67 | bool isBackgroundDropShadowEnabled() const { return m_backgroundDropShadowEnabled; } |
|
68 | 68 | QPen gridLinePen() const { return m_gridLinePen; } |
|
69 | 69 | QPen minorGridLinePen() const { return m_minorGridLinePen; } |
|
70 | 70 | |
|
71 | 71 | protected: |
|
72 | 72 | QChart::ChartTheme m_id; |
|
73 | 73 | QList<QColor> m_seriesColors; |
|
74 | 74 | QList<QGradient> m_seriesGradients; |
|
75 | 75 | QLinearGradient m_chartBackgroundGradient; |
|
76 | 76 | |
|
77 | 77 | QFont m_masterFont; |
|
78 | 78 | QFont m_labelFont; |
|
79 | 79 | QBrush m_labelBrush; |
|
80 | 80 | QPen m_axisLinePen; |
|
81 | 81 | QPen m_backgroundShadesPen; |
|
82 | 82 | QPen m_outlinePen; |
|
83 | 83 | QBrush m_backgroundShadesBrush; |
|
84 | 84 | BackgroundShadesMode m_backgroundShades; |
|
85 | 85 | bool m_backgroundDropShadowEnabled; |
|
86 | 86 | QPen m_gridLinePen; |
|
87 | 87 | QPen m_minorGridLinePen; |
|
88 | 88 | |
|
89 | 89 | }; |
|
90 | 90 | |
|
91 | 91 | QT_CHARTS_END_NAMESPACE |
|
92 | 92 | |
|
93 | 93 | #endif // CHARTTHEME_H |
@@ -1,71 +1,71 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEBLUECERULEAN_P_H |
|
29 | 29 | #define CHARTTHEMEBLUECERULEAN_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeBlueCerulean: public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeBlueCerulean() : ChartTheme(QChart::ChartThemeBlueCerulean) { |
|
39 | 39 | // Series colors |
|
40 | 40 | m_seriesColors << QRgb(0xc7e85b); |
|
41 | 41 | m_seriesColors << QRgb(0x1cb54f); |
|
42 | 42 | m_seriesColors << QRgb(0x5cbf9b); |
|
43 | 43 | m_seriesColors << QRgb(0x009fbf); |
|
44 | 44 | m_seriesColors << QRgb(0xee7392); |
|
45 | 45 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
46 | 46 | |
|
47 | 47 | // Background |
|
48 | 48 | QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); |
|
49 | 49 | backgroundGradient.setColorAt(0.0, QRgb(0x056189)); |
|
50 | 50 | backgroundGradient.setColorAt(1.0, QRgb(0x101a31)); |
|
51 | 51 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
52 | 52 | m_chartBackgroundGradient = backgroundGradient; |
|
53 | 53 | |
|
54 | 54 | // Axes and other |
|
55 | 55 | m_labelBrush = QBrush(QRgb(0xffffff)); |
|
56 | 56 | m_axisLinePen = QPen(QRgb(0xd6d6d6)); |
|
57 | 57 | m_axisLinePen.setWidth(2); |
|
58 | 58 | m_gridLinePen = QPen(QRgb(0x84a2b0)); |
|
59 | 59 | m_gridLinePen.setWidth(1); |
|
60 | 60 | m_minorGridLinePen = QPen(QRgb(0x84a2b0)); |
|
61 | 61 | m_minorGridLinePen.setWidth(1); |
|
62 | 62 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
63 | 63 | m_backgroundShades = BackgroundShadesNone; |
|
64 | 64 | m_outlinePen = QPen(QRgb(0xebebeb)); |
|
65 | 65 | m_outlinePen.setWidthF(2.0); |
|
66 | 66 | } |
|
67 | 67 | }; |
|
68 | 68 | |
|
69 | 69 | QT_CHARTS_END_NAMESPACE |
|
70 | 70 | |
|
71 | 71 | #endif |
@@ -1,73 +1,73 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEBLUEICY_P_H |
|
29 | 29 | #define CHARTTHEMEBLUEICY_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeBlueIcy: public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeBlueIcy() : ChartTheme(QChart::ChartThemeBlueIcy) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x3daeda); |
|
42 | 42 | m_seriesColors << QRgb(0x2685bf); |
|
43 | 43 | m_seriesColors << QRgb(0x0c2673); |
|
44 | 44 | m_seriesColors << QRgb(0x5f3dba); |
|
45 | 45 | m_seriesColors << QRgb(0x2fa3b4); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | m_backgroundDropShadowEnabled = true; |
|
55 | 55 | |
|
56 | 56 | // Axes and other |
|
57 | 57 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
58 | 58 | m_axisLinePen = QPen(QRgb(0xd6d6d6)); |
|
59 | 59 | m_axisLinePen.setWidth(2); |
|
60 | 60 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
61 | 61 | m_gridLinePen.setWidth(1); |
|
62 | 62 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
63 | 63 | m_minorGridLinePen.setWidth(1); |
|
64 | 64 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
65 | 65 | m_backgroundShades = BackgroundShadesNone; |
|
66 | 66 | m_outlinePen = QPen(QRgb(0x474747)); |
|
67 | 67 | m_outlinePen.setWidthF(2.0); |
|
68 | 68 | } |
|
69 | 69 | }; |
|
70 | 70 | |
|
71 | 71 | QT_CHARTS_END_NAMESPACE |
|
72 | 72 | |
|
73 | 73 | #endif |
@@ -1,72 +1,72 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEBLUENCS_P_H |
|
29 | 29 | #define CHARTTHEMEBLUENCS_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeBlueNcs: public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeBlueNcs() : ChartTheme(QChart::ChartThemeBlueNcs) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x1db0da); |
|
42 | 42 | m_seriesColors << QRgb(0x1341a6); |
|
43 | 43 | m_seriesColors << QRgb(0x88d41e); |
|
44 | 44 | m_seriesColors << QRgb(0xff8e1a); |
|
45 | 45 | m_seriesColors << QRgb(0x398ca3); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient; |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | |
|
55 | 55 | // Axes and other |
|
56 | 56 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
57 | 57 | m_axisLinePen = QPen(QRgb(0xd6d6d6)); |
|
58 | 58 | m_axisLinePen.setWidth(2); |
|
59 | 59 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
60 | 60 | m_gridLinePen.setWidth(1); |
|
61 | 61 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
62 | 62 | m_minorGridLinePen.setWidth(1); |
|
63 | 63 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
64 | 64 | m_backgroundShades = BackgroundShadesNone; |
|
65 | 65 | m_outlinePen = QPen(QRgb(0x474747)); |
|
66 | 66 | m_outlinePen.setWidthF(2.0); |
|
67 | 67 | } |
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | QT_CHARTS_END_NAMESPACE |
|
71 | 71 | |
|
72 | 72 | #endif |
@@ -1,72 +1,72 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEBROWNSAND_P_H |
|
29 | 29 | #define CHARTTHEMEBROWNSAND_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeBrownSand: public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeBrownSand() : ChartTheme(QChart::ChartThemeBrownSand) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0xb39b72); |
|
42 | 42 | m_seriesColors << QRgb(0xb3b376); |
|
43 | 43 | m_seriesColors << QRgb(0xc35660); |
|
44 | 44 | m_seriesColors << QRgb(0x536780); |
|
45 | 45 | m_seriesColors << QRgb(0x494345); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient; |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0xf3ece0)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0xf3ece0)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | |
|
55 | 55 | // Axes and other |
|
56 | 56 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
57 | 57 | m_axisLinePen = QPen(QRgb(0xb5b0a7)); |
|
58 | 58 | m_axisLinePen.setWidth(2); |
|
59 | 59 | m_gridLinePen = QPen(QRgb(0xd4cec3)); |
|
60 | 60 | m_gridLinePen.setWidth(1); |
|
61 | 61 | m_minorGridLinePen = QPen(QRgb(0xd4cec3)); |
|
62 | 62 | m_minorGridLinePen.setWidth(1); |
|
63 | 63 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
64 | 64 | m_backgroundShades = BackgroundShadesNone; |
|
65 | 65 | m_outlinePen = QPen(QRgb(0x222222)); |
|
66 | 66 | m_outlinePen.setWidthF(2.0); |
|
67 | 67 | } |
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | QT_CHARTS_END_NAMESPACE |
|
71 | 71 | |
|
72 | 72 | #endif |
@@ -1,72 +1,72 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEDARK_P_H |
|
29 | 29 | #define CHARTTHEMEDARK_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeDark : public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeDark() : ChartTheme(QChart::ChartThemeDark) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x38ad6b); |
|
42 | 42 | m_seriesColors << QRgb(0x3c84a7); |
|
43 | 43 | m_seriesColors << QRgb(0xeb8817); |
|
44 | 44 | m_seriesColors << QRgb(0x7b7f8c); |
|
45 | 45 | m_seriesColors << QRgb(0xbf593e); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0x2e303a)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0x121218)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | |
|
55 | 55 | // Axes and other |
|
56 | 56 | m_labelBrush = QBrush(QRgb(0xffffff)); |
|
57 | 57 | m_axisLinePen = QPen(QRgb(0x86878c)); |
|
58 | 58 | m_axisLinePen.setWidth(2); |
|
59 | 59 | m_gridLinePen = QPen(QRgb(0x86878c)); |
|
60 | 60 | m_gridLinePen.setWidth(1); |
|
61 | 61 | m_minorGridLinePen = QPen(QRgb(0x86878c)); |
|
62 | 62 | m_minorGridLinePen.setWidth(1); |
|
63 | 63 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
64 | 64 | m_backgroundShades = BackgroundShadesNone; |
|
65 | 65 | m_outlinePen = QPen(QRgb(0xd6d6d6)); |
|
66 | 66 | m_outlinePen.setWidthF(2.0); |
|
67 | 67 | } |
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | QT_CHARTS_END_NAMESPACE |
|
71 | 71 | |
|
72 | 72 | #endif |
@@ -1,74 +1,74 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEHIGHCONTRAST_P_H |
|
29 | 29 | #define CHARTTHEMEHIGHCONTRAST_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeHighContrast : public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeHighContrast() : ChartTheme(QChart::ChartThemeHighContrast) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x202020); |
|
42 | 42 | m_seriesColors << QRgb(0x596a74); |
|
43 | 43 | m_seriesColors << QRgb(0xffab03); |
|
44 | 44 | m_seriesColors << QRgb(0x038e9b); |
|
45 | 45 | m_seriesColors << QRgb(0xff4a41); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | m_backgroundDropShadowEnabled = true; |
|
55 | 55 | |
|
56 | 56 | // Axes and other |
|
57 | 57 | m_labelBrush = QBrush(QRgb(0x181818)); |
|
58 | 58 | m_axisLinePen = QPen(QRgb(0x8c8c8c)); |
|
59 | 59 | m_axisLinePen.setWidth(2); |
|
60 | 60 | m_gridLinePen = QPen(QRgb(0x8c8c8c)); |
|
61 | 61 | m_gridLinePen.setWidth(1); |
|
62 | 62 | m_minorGridLinePen = QPen(QRgb(0x8c8c8c)); |
|
63 | 63 | m_minorGridLinePen.setWidth(1); |
|
64 | 64 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
65 | 65 | m_backgroundShadesBrush = QBrush(QRgb(0xffeecd)); |
|
66 | 66 | m_backgroundShades = BackgroundShadesHorizontal; |
|
67 | 67 | m_outlinePen = QPen(QColor(Qt::black)); |
|
68 | 68 | m_outlinePen.setWidthF(2.0); |
|
69 | 69 | } |
|
70 | 70 | }; |
|
71 | 71 | |
|
72 | 72 | QT_CHARTS_END_NAMESPACE |
|
73 | 73 | |
|
74 | 74 | #endif |
@@ -1,74 +1,74 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMELIGHT_P_H |
|
29 | 29 | #define CHARTTHEMELIGHT_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeLight: public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeLight() : ChartTheme(QChart::ChartThemeLight) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x209fdf); |
|
42 | 42 | m_seriesColors << QRgb(0x99ca53); |
|
43 | 43 | m_seriesColors << QRgb(0xf6a625); |
|
44 | 44 | m_seriesColors << QRgb(0x6d5fd5); |
|
45 | 45 | m_seriesColors << QRgb(0xbf593e); |
|
46 | 46 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
47 | 47 | |
|
48 | 48 | // Background |
|
49 | 49 | QLinearGradient backgroundGradient; |
|
50 | 50 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
51 | 51 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
52 | 52 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
53 | 53 | m_chartBackgroundGradient = backgroundGradient; |
|
54 | 54 | // There is a performance issue in the drop shadow implementation, so disabled for now |
|
55 | 55 | // m_backgroundDropShadowEnabled = true; |
|
56 | 56 | |
|
57 | 57 | // Axes and other |
|
58 | 58 | m_axisLinePen = QPen(0xd6d6d6); |
|
59 | 59 | m_axisLinePen.setWidth(1); |
|
60 | 60 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
61 | 61 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
62 | 62 | m_gridLinePen.setWidth(1); |
|
63 | 63 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
64 | 64 | m_minorGridLinePen.setWidth(1); |
|
65 | 65 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
66 | 66 | m_backgroundShades = BackgroundShadesNone; |
|
67 | 67 | m_outlinePen = QPen(0x4d4d4d); |
|
68 | 68 | m_outlinePen.setWidthF(2.0); |
|
69 | 69 | } |
|
70 | 70 | }; |
|
71 | 71 | |
|
72 | 72 | QT_CHARTS_END_NAMESPACE |
|
73 | 73 | |
|
74 | 74 | #endif |
@@ -1,75 +1,75 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMEQT_P_H |
|
29 | 29 | #define CHARTTHEMEQT_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class ChartThemeQt : public ChartTheme |
|
36 | 36 | { |
|
37 | 37 | public: |
|
38 | 38 | ChartThemeQt() : ChartTheme(QChart::ChartThemeQt) |
|
39 | 39 | { |
|
40 | 40 | // Series colors |
|
41 | 41 | m_seriesColors << QRgb(0x80c342); |
|
42 | 42 | m_seriesColors << QRgb(0x328930); |
|
43 | 43 | m_seriesColors << QRgb(0x006325); |
|
44 | 44 | m_seriesColors << QRgb(0x35322f); |
|
45 | 45 | m_seriesColors << QRgb(0x5d5b59); |
|
46 | 46 | m_seriesColors << QRgb(0x868482); |
|
47 | 47 | m_seriesColors << QRgb(0xaeadac); |
|
48 | 48 | m_seriesColors << QRgb(0xd7d6d5); |
|
49 | 49 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
50 | 50 | |
|
51 | 51 | // Background |
|
52 | 52 | QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); |
|
53 | 53 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
54 | 54 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
55 | 55 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
56 | 56 | m_chartBackgroundGradient = backgroundGradient; |
|
57 | 57 | |
|
58 | 58 | // Axes and other |
|
59 | 59 | m_labelBrush = QBrush(QRgb(0x35322f)); |
|
60 | 60 | m_axisLinePen = QPen(QRgb(0xd7d6d5)); |
|
61 | 61 | m_axisLinePen.setWidth(1); |
|
62 | 62 | m_gridLinePen = QPen(QRgb(0xd7d6d5)); |
|
63 | 63 | m_gridLinePen.setWidth(1); |
|
64 | 64 | m_minorGridLinePen = QPen(QRgb(0xd7d6d5)); |
|
65 | 65 | m_minorGridLinePen.setWidth(1); |
|
66 | 66 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
67 | 67 | m_backgroundShades = BackgroundShadesNone; |
|
68 | 68 | m_outlinePen = QPen(QRgb(0x35322f)); |
|
69 | 69 | m_outlinePen.setWidthF(2.0); |
|
70 | 70 | } |
|
71 | 71 | }; |
|
72 | 72 | |
|
73 | 73 | QT_CHARTS_END_NAMESPACE |
|
74 | 74 | |
|
75 | 75 | #endif |
@@ -1,187 +1,187 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef CHARTTHEMESYSTEM_P_H |
|
29 | 29 | #define CHARTTHEMESYSTEM_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/charttheme_p.h> |
|
32 | 32 | #ifdef Q_OS_WIN |
|
33 | 33 | #include <windows.h> |
|
34 | 34 | #include <stdio.h> |
|
35 | 35 | #endif |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class ChartThemeSystem: public ChartTheme |
|
40 | 40 | { |
|
41 | 41 | public: |
|
42 | 42 | // System theme not used at the moment (the user is not able to select this theme) |
|
43 | 43 | ChartThemeSystem() : ChartTheme(QChart::ChartThemeLight /*QChart::ChartThemeSystem*/) |
|
44 | 44 | { |
|
45 | 45 | #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) |
|
46 | 46 | // We could also use theme specific window frame color as a series base color (it would give more |
|
47 | 47 | // variation to the base colors in addition to the blue and black used now) |
|
48 | 48 | |
|
49 | 49 | // First series base color from COLOR_HIGHLIGHT |
|
50 | 50 | DWORD colorHighlight; |
|
51 | 51 | colorHighlight = GetSysColor(COLOR_HIGHLIGHT); |
|
52 | 52 | m_seriesColors.append(QColor(GetRValue(colorHighlight), |
|
53 | 53 | GetGValue(colorHighlight), |
|
54 | 54 | GetBValue(colorHighlight))); |
|
55 | 55 | |
|
56 | 56 | // Second series base color from COLOR_WINDOWFRAME |
|
57 | 57 | DWORD colorWindowFrame; |
|
58 | 58 | colorWindowFrame = GetSysColor(COLOR_WINDOWFRAME); |
|
59 | 59 | m_seriesColors.append(QColor(GetRValue(colorWindowFrame), |
|
60 | 60 | GetGValue(colorWindowFrame), |
|
61 | 61 | GetBValue(colorWindowFrame))); |
|
62 | 62 | |
|
63 | 63 | // Third series base color from the middle of the COLOR_ACTIVECAPTION / |
|
64 | 64 | // COLOR_GRADIENTACTIVECAPTION gradient |
|
65 | 65 | DWORD colorGradientActiveCaptionLeft; |
|
66 | 66 | colorGradientActiveCaptionLeft = GetSysColor(COLOR_ACTIVECAPTION); |
|
67 | 67 | DWORD colorGradientActiveCaptionRight; |
|
68 | 68 | colorGradientActiveCaptionRight = GetSysColor(COLOR_GRADIENTACTIVECAPTION); |
|
69 | 69 | QLinearGradient g; |
|
70 | 70 | QColor start = QColor(GetRValue(colorGradientActiveCaptionLeft), |
|
71 | 71 | GetGValue(colorGradientActiveCaptionLeft), |
|
72 | 72 | GetBValue(colorGradientActiveCaptionLeft)); |
|
73 | 73 | g.setColorAt(0.0, start); |
|
74 | 74 | QColor end = QColor(GetRValue(colorGradientActiveCaptionRight), |
|
75 | 75 | GetGValue(colorGradientActiveCaptionRight), |
|
76 | 76 | GetBValue(colorGradientActiveCaptionRight)); |
|
77 | 77 | g.setColorAt(1.0, end); |
|
78 | 78 | m_seriesColors.append(ChartThemeManager::colorAt(g, 0.5)); |
|
79 | 79 | |
|
80 | 80 | // Generate gradients from the base colors |
|
81 | 81 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
82 | 82 | |
|
83 | 83 | // Background fill color from COLOR_WINDOW |
|
84 | 84 | QLinearGradient backgroundGradient; |
|
85 | 85 | DWORD colorWindow; |
|
86 | 86 | colorWindow = GetSysColor(COLOR_WINDOW); |
|
87 | 87 | backgroundGradient.setColorAt(0.0, QColor(GetRValue(colorWindow), |
|
88 | 88 | GetGValue(colorWindow), |
|
89 | 89 | GetBValue(colorWindow))); |
|
90 | 90 | backgroundGradient.setColorAt(1.0, QColor(GetRValue(colorWindow), |
|
91 | 91 | GetGValue(colorWindow), |
|
92 | 92 | GetBValue(colorWindow))); |
|
93 | 93 | // Axes and other |
|
94 | 94 | m_axisLinePen = QPen(0xd6d6d6); |
|
95 | 95 | m_axisLinePen.setWidth(1); |
|
96 | 96 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
97 | 97 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
98 | 98 | m_gridLinePen.setWidth(1); |
|
99 | 99 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
100 | 100 | m_minorGridLinePen.setWidth(1); |
|
101 | 101 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
102 | 102 | m_backgroundShades = BackgroundShadesNone; |
|
103 | 103 | |
|
104 | 104 | #elif defined(Q_OS_LINUX) |
|
105 | 105 | // Using a hard coded theme for Linux system theme |
|
106 | 106 | m_seriesColors << QRgb(0x60a6e6); |
|
107 | 107 | m_seriesColors << QRgb(0x92ca66); |
|
108 | 108 | m_seriesColors << QRgb(0xeba85f); |
|
109 | 109 | m_seriesColors << QRgb(0xfc5751); |
|
110 | 110 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
111 | 111 | |
|
112 | 112 | // Background |
|
113 | 113 | QLinearGradient backgroundGradient; |
|
114 | 114 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
115 | 115 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
116 | 116 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
117 | 117 | m_chartBackgroundGradient = backgroundGradient; |
|
118 | 118 | |
|
119 | 119 | // Axes and other |
|
120 | 120 | m_axisLinePen = QPen(0xd6d6d6); |
|
121 | 121 | m_axisLinePen.setWidth(1); |
|
122 | 122 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
123 | 123 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
124 | 124 | m_gridLinePen.setWidth(1); |
|
125 | 125 | m_minorGridLinePen = QPen(QRgb(0x404044)); |
|
126 | 126 | m_minorGridLinePen.setWidth(1); |
|
127 | 127 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
128 | 128 | m_backgroundShades = BackgroundShadesNone; |
|
129 | 129 | |
|
130 | 130 | #elif defined(Q_OS_MAC) |
|
131 | 131 | // Using a hard coded theme for OSX system theme; the colors match the OSX 10.7 colors |
|
132 | 132 | m_seriesColors << QRgb(0x60a6e6); |
|
133 | 133 | m_seriesColors << QRgb(0x92ca66); |
|
134 | 134 | m_seriesColors << QRgb(0xeba85f); |
|
135 | 135 | m_seriesColors << QRgb(0xfc5751); |
|
136 | 136 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
137 | 137 | |
|
138 | 138 | // Background |
|
139 | 139 | QLinearGradient backgroundGradient; |
|
140 | 140 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
141 | 141 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
142 | 142 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
143 | 143 | m_chartBackgroundGradient = backgroundGradient; |
|
144 | 144 | |
|
145 | 145 | // Axes and other |
|
146 | 146 | m_axisLinePen = QPen(0xd6d6d6); |
|
147 | 147 | m_axisLinePen.setWidth(1); |
|
148 | 148 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
149 | 149 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
150 | 150 | m_gridLinePen.setWidth(1); |
|
151 | 151 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
152 | 152 | m_minorGridLinePen.setWidth(1); |
|
153 | 153 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
154 | 154 | m_backgroundShades = BackgroundShadesNone; |
|
155 | 155 | |
|
156 | 156 | #else |
|
157 | 157 | // Hard coded theme |
|
158 | 158 | m_seriesColors << QRgb(0x60a6e6); |
|
159 | 159 | m_seriesColors << QRgb(0x92ca66); |
|
160 | 160 | m_seriesColors << QRgb(0xeba85f); |
|
161 | 161 | m_seriesColors << QRgb(0xfc5751); |
|
162 | 162 | m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); |
|
163 | 163 | |
|
164 | 164 | // Background |
|
165 | 165 | QLinearGradient backgroundGradient; |
|
166 | 166 | backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); |
|
167 | 167 | backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); |
|
168 | 168 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
169 | 169 | m_chartBackgroundGradient = backgroundGradient; |
|
170 | 170 | |
|
171 | 171 | // Axes and other |
|
172 | 172 | m_axisLinePen = QPen(0xd6d6d6); |
|
173 | 173 | m_axisLinePen.setWidth(1); |
|
174 | 174 | m_labelBrush = QBrush(QRgb(0x404044)); |
|
175 | 175 | m_gridLinePen = QPen(QRgb(0xe2e2e2)); |
|
176 | 176 | m_gridLinePen.setWidth(1); |
|
177 | 177 | m_minorGridLinePen = QPen(QRgb(0xe2e2e2)); |
|
178 | 178 | m_minorGridLinePen.setWidth(1); |
|
179 | 179 | m_minorGridLinePen.setStyle(Qt::DashLine); |
|
180 | 180 | m_backgroundShades = BackgroundShadesNone; |
|
181 | 181 | #endif |
|
182 | 182 | } |
|
183 | 183 | }; |
|
184 | 184 | |
|
185 | 185 | QT_CHARTS_END_NAMESPACE |
|
186 | 186 | |
|
187 | 187 | #endif // CHARTTHEMESYSTEM_P_H |
@@ -1,98 +1,98 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QXYMODELMAPPER_P_H |
|
29 | 29 | #define QXYMODELMAPPER_P_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QXYModelMapper> |
|
32 | 32 | #include <QtCore/QObject> |
|
33 | 33 | |
|
34 | 34 | QT_BEGIN_NAMESPACE |
|
35 | 35 | class QModelIndex; |
|
36 | 36 | class QAbstractItemModel; |
|
37 | 37 | class QPointF; |
|
38 | 38 | QT_END_NAMESPACE |
|
39 | 39 | |
|
40 | 40 | QT_CHARTS_BEGIN_NAMESPACE |
|
41 | 41 | |
|
42 | 42 | class QXYModelMapper; |
|
43 | 43 | class QXYSeries; |
|
44 | 44 | |
|
45 | 45 | class QXYModelMapperPrivate : public QObject |
|
46 | 46 | { |
|
47 | 47 | Q_OBJECT |
|
48 | 48 | |
|
49 | 49 | public: |
|
50 | 50 | QXYModelMapperPrivate(QXYModelMapper *q); |
|
51 | 51 | |
|
52 | 52 | public Q_SLOTS: |
|
53 | 53 | // for the model |
|
54 | 54 | void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); |
|
55 | 55 | void modelRowsAdded(QModelIndex parent, int start, int end); |
|
56 | 56 | void modelRowsRemoved(QModelIndex parent, int start, int end); |
|
57 | 57 | void modelColumnsAdded(QModelIndex parent, int start, int end); |
|
58 | 58 | void modelColumnsRemoved(QModelIndex parent, int start, int end); |
|
59 | 59 | void handleModelDestroyed(); |
|
60 | 60 | |
|
61 | 61 | // for the series |
|
62 | 62 | void handlePointAdded(int pointPos); |
|
63 | 63 | void handlePointRemoved(int pointPos); |
|
64 | 64 | void handlePointsRemoved(int pointPos, int count); |
|
65 | 65 | void handlePointReplaced(int pointPos); |
|
66 | 66 | void handleSeriesDestroyed(); |
|
67 | 67 | |
|
68 | 68 | void initializeXYFromModel(); |
|
69 | 69 | |
|
70 | 70 | private: |
|
71 | 71 | QModelIndex xModelIndex(int xPos); |
|
72 | 72 | QModelIndex yModelIndex(int yPos); |
|
73 | 73 | void insertData(int start, int end); |
|
74 | 74 | void removeData(int start, int end); |
|
75 | 75 | void blockModelSignals(bool block = true); |
|
76 | 76 | void blockSeriesSignals(bool block = true); |
|
77 | 77 | qreal valueFromModel(QModelIndex index); |
|
78 | 78 | void setValueToModel(QModelIndex index, qreal value); |
|
79 | 79 | |
|
80 | 80 | private: |
|
81 | 81 | QXYSeries *m_series; |
|
82 | 82 | QAbstractItemModel *m_model; |
|
83 | 83 | int m_first; |
|
84 | 84 | int m_count; |
|
85 | 85 | Qt::Orientation m_orientation; |
|
86 | 86 | int m_xSection; |
|
87 | 87 | int m_ySection; |
|
88 | 88 | bool m_seriesSignalsBlock; |
|
89 | 89 | bool m_modelSignalsBlock; |
|
90 | 90 | |
|
91 | 91 | private: |
|
92 | 92 | QXYModelMapper *q_ptr; |
|
93 | 93 | Q_DECLARE_PUBLIC(QXYModelMapper) |
|
94 | 94 | }; |
|
95 | 95 | |
|
96 | 96 | QT_CHARTS_END_NAMESPACE |
|
97 | 97 | |
|
98 | 98 | #endif // QXYMODELMAPPER_P_H |
@@ -1,78 +1,78 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef QXYSERIES_P_H |
|
29 | 29 | #define QXYSERIES_P_H |
|
30 | 30 | |
|
31 | 31 | #include <private/qabstractseries_p.h> |
|
32 | 32 | |
|
33 | 33 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | 34 | |
|
35 | 35 | class QXYSeries; |
|
36 | 36 | class QAbstractAxis; |
|
37 | 37 | |
|
38 | 38 | class QXYSeriesPrivate: public QAbstractSeriesPrivate |
|
39 | 39 | { |
|
40 | 40 | Q_OBJECT |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | QXYSeriesPrivate(QXYSeries *q); |
|
44 | 44 | |
|
45 | 45 | void initializeDomain(); |
|
46 | 46 | void initializeAxes(); |
|
47 | 47 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, |
|
48 | 48 | QEasingCurve &curve); |
|
49 | 49 | |
|
50 | 50 | QList<QLegendMarker*> createLegendMarkers(QLegend* legend); |
|
51 | 51 | |
|
52 | 52 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
53 | 53 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const; |
|
54 | 54 | |
|
55 | 55 | void drawSeriesPointLabels(QPainter *painter, const QVector<QPointF> &points, |
|
56 | 56 | const int offset = 0); |
|
57 | 57 | |
|
58 | 58 | Q_SIGNALS: |
|
59 | 59 | void updated(); |
|
60 | 60 | |
|
61 | 61 | protected: |
|
62 | 62 | QVector<QPointF> m_points; |
|
63 | 63 | QPen m_pen; |
|
64 | 64 | QBrush m_brush; |
|
65 | 65 | bool m_pointsVisible; |
|
66 | 66 | QString m_pointLabelsFormat; |
|
67 | 67 | bool m_pointLabelsVisible; |
|
68 | 68 | QFont m_pointLabelsFont; |
|
69 | 69 | QColor m_pointLabelsColor; |
|
70 | 70 | |
|
71 | 71 | private: |
|
72 | 72 | Q_DECLARE_PUBLIC(QXYSeries) |
|
73 | 73 | friend class QScatterSeries; |
|
74 | 74 | }; |
|
75 | 75 | |
|
76 | 76 | QT_CHARTS_END_NAMESPACE |
|
77 | 77 | |
|
78 | 78 | #endif |
@@ -1,94 +1,94 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Charts module. |
|
8 | 8 | ** |
|
9 | 9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
10 | 10 | ** accordance with the Qt License Agreement provided with the Software |
|
11 | 11 | ** or, alternatively, in accordance with the terms contained in a written |
|
12 | 12 | ** agreement between you and The Qt Company. |
|
13 | 13 | ** |
|
14 | 14 | ** If you have questions regarding the use of this file, please use |
|
15 | 15 | ** contact form at http://qt.io |
|
16 | 16 | ** |
|
17 | 17 | ****************************************************************************/ |
|
18 | 18 | |
|
19 | 19 | // W A R N I N G |
|
20 | 20 | // ------------- |
|
21 | 21 | // |
|
22 |
// This file is not part of the Qt |
|
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
|
23 | 23 | // implementation detail. This header file may change from version to |
|
24 | 24 | // version without notice, or even be removed. |
|
25 | 25 | // |
|
26 | 26 | // We mean it. |
|
27 | 27 | |
|
28 | 28 | #ifndef XYCHART_H |
|
29 | 29 | #define XYCHART_H |
|
30 | 30 | |
|
31 | 31 | #include <QtCharts/QChartGlobal> |
|
32 | 32 | #include <private/chartitem_p.h> |
|
33 | 33 | #include <private/xyanimation_p.h> |
|
34 | 34 | #include <QtCharts/QValueAxis> |
|
35 | 35 | #include <QtGui/QPen> |
|
36 | 36 | |
|
37 | 37 | QT_CHARTS_BEGIN_NAMESPACE |
|
38 | 38 | |
|
39 | 39 | class ChartPresenter; |
|
40 | 40 | class QXYSeries; |
|
41 | 41 | |
|
42 | 42 | class XYChart : public ChartItem |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | public: |
|
46 | 46 | explicit XYChart(QXYSeries *series,QGraphicsItem *item = 0); |
|
47 | 47 | ~XYChart() {} |
|
48 | 48 | |
|
49 | 49 | void setGeometryPoints(const QVector<QPointF> &points); |
|
50 | 50 | QVector<QPointF> geometryPoints() const { return m_points; } |
|
51 | 51 | |
|
52 | 52 | void setAnimation(XYAnimation *animation); |
|
53 | 53 | ChartAnimation *animation() const { return m_animation; } |
|
54 | 54 | virtual void updateGeometry() = 0; |
|
55 | 55 | |
|
56 | 56 | bool isDirty() const { return m_dirty; } |
|
57 | 57 | void setDirty(bool dirty); |
|
58 | 58 | |
|
59 | 59 | void getSeriesRanges(qreal &minX, qreal &maxX, qreal &minY, qreal &maxY); |
|
60 | 60 | QVector<bool> offGridStatusVector(); |
|
61 | 61 | |
|
62 | 62 | public Q_SLOTS: |
|
63 | 63 | void handlePointAdded(int index); |
|
64 | 64 | void handlePointRemoved(int index); |
|
65 | 65 | void handlePointsRemoved(int index, int count); |
|
66 | 66 | void handlePointReplaced(int index); |
|
67 | 67 | void handlePointsReplaced(); |
|
68 | 68 | void handleDomainUpdated(); |
|
69 | 69 | |
|
70 | 70 | Q_SIGNALS: |
|
71 | 71 | void clicked(const QPointF &point); |
|
72 | 72 | void hovered(const QPointF &point, bool state); |
|
73 | 73 | void pressed(const QPointF &point); |
|
74 | 74 | void released(const QPointF &point); |
|
75 | 75 | void doubleClicked(const QPointF &point); |
|
76 | 76 | |
|
77 | 77 | protected: |
|
78 | 78 | virtual void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index = -1); |
|
79 | 79 | |
|
80 | 80 | private: |
|
81 | 81 | inline bool isEmpty(); |
|
82 | 82 | |
|
83 | 83 | protected: |
|
84 | 84 | QXYSeries *m_series; |
|
85 | 85 | QVector<QPointF> m_points; |
|
86 | 86 | XYAnimation *m_animation; |
|
87 | 87 | bool m_dirty; |
|
88 | 88 | |
|
89 | 89 | friend class AreaChartItem; |
|
90 | 90 | }; |
|
91 | 91 | |
|
92 | 92 | QT_CHARTS_END_NAMESPACE |
|
93 | 93 | |
|
94 | 94 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now