##// END OF EJS Templates
Removed some unnecessary includes
Marek Rosa -
r1668:8bddc9b03a3a
parent child
Show More
@@ -1,70 +1,69
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #ifndef QBARMODELMAPPER_H
21 #ifndef QBARMODELMAPPER_H
22 #define QBARMODELMAPPER_H
22 #define QBARMODELMAPPER_H
23
23
24 #include "qchartglobal.h"
24 #include "qchartglobal.h"
25 #include <QObject>
25 #include <QObject>
26
26
27 class QAbstractItemModel;
27 class QAbstractItemModel;
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 class QBarModelMapperPrivate;
31 class QBarModelMapperPrivate;
32 class QAbstractBarSeries;
32 class QAbstractBarSeries;
33 class QChart;
34
33
35 class QTCOMMERCIALCHART_EXPORT QBarModelMapper : public QObject
34 class QTCOMMERCIALCHART_EXPORT QBarModelMapper : public QObject
36 {
35 {
37 Q_OBJECT
36 Q_OBJECT
38
37
39 protected:
38 protected:
40 explicit QBarModelMapper(QObject *parent = 0);
39 explicit QBarModelMapper(QObject *parent = 0);
41
40
42 QAbstractItemModel* model() const;
41 QAbstractItemModel* model() const;
43 void setModel(QAbstractItemModel *model);
42 void setModel(QAbstractItemModel *model);
44
43
45 QAbstractBarSeries* series() const;
44 QAbstractBarSeries* series() const;
46 void setSeries(QAbstractBarSeries *series);
45 void setSeries(QAbstractBarSeries *series);
47
46
48 int first() const;
47 int first() const;
49 void setFirst(int first);
48 void setFirst(int first);
50
49
51 int count() const;
50 int count() const;
52 void setCount(int count);
51 void setCount(int count);
53
52
54 int firstBarSetSection() const;
53 int firstBarSetSection() const;
55 void setFirstBarSetSection(int firstBarSetSection);
54 void setFirstBarSetSection(int firstBarSetSection);
56
55
57 int lastBarSetSection() const;
56 int lastBarSetSection() const;
58 void setLastBarSetSection(int lastBarSetSection);
57 void setLastBarSetSection(int lastBarSetSection);
59
58
60 Qt::Orientation orientation() const;
59 Qt::Orientation orientation() const;
61 void setOrientation(Qt::Orientation orientation);
60 void setOrientation(Qt::Orientation orientation);
62
61
63 protected:
62 protected:
64 QBarModelMapperPrivate * const d_ptr;
63 QBarModelMapperPrivate * const d_ptr;
65 Q_DECLARE_PRIVATE(QBarModelMapper)
64 Q_DECLARE_PRIVATE(QBarModelMapper)
66 };
65 };
67
66
68 QTCOMMERCIALCHART_END_NAMESPACE
67 QTCOMMERCIALCHART_END_NAMESPACE
69
68
70 #endif // QBARMODELMAPPER_H
69 #endif // QBARMODELMAPPER_H
@@ -1,97 +1,96
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 // W A R N I N G
21 // W A R N I N G
22 // -------------
22 // -------------
23 //
23 //
24 // This file is not part of the QtCommercial Chart API. It exists purely as an
24 // This file is not part of the QtCommercial Chart API. It exists purely as an
25 // implementation detail. This header file may change from version to
25 // implementation detail. This header file may change from version to
26 // version without notice, or even be removed.
26 // version without notice, or even be removed.
27 //
27 //
28 // We mean it.
28 // We mean it.
29
29
30 #ifndef QBARMODELMAPPER_P_H
30 #ifndef QBARMODELMAPPER_P_H
31 #define QBARMODELMAPPER_P_H
31 #define QBARMODELMAPPER_P_H
32
32
33 #include "qchartglobal.h"
34 #include <QObject>
33 #include <QObject>
35 #include "qbarmodelmapper.h"
34 #include "qbarmodelmapper.h"
36
35
37 class QModelIndex;
36 class QModelIndex;
38
37
39 QTCOMMERCIALCHART_BEGIN_NAMESPACE
38 QTCOMMERCIALCHART_BEGIN_NAMESPACE
40
39
41 class QBarSet;
40 class QBarSet;
42
41
43 class QBarModelMapperPrivate : public QObject
42 class QBarModelMapperPrivate : public QObject
44 {
43 {
45 Q_OBJECT
44 Q_OBJECT
46 public:
45 public:
47 explicit QBarModelMapperPrivate(QBarModelMapper *q);
46 explicit QBarModelMapperPrivate(QBarModelMapper *q);
48
47
49 public Q_SLOTS:
48 public Q_SLOTS:
50 // for the model
49 // for the model
51 void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight);
50 void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight);
52 void modelHeaderDataUpdated(Qt::Orientation orientation, int first, int last);
51 void modelHeaderDataUpdated(Qt::Orientation orientation, int first, int last);
53 void modelRowsAdded(QModelIndex parent, int start, int end);
52 void modelRowsAdded(QModelIndex parent, int start, int end);
54 void modelRowsRemoved(QModelIndex parent, int start, int end);
53 void modelRowsRemoved(QModelIndex parent, int start, int end);
55 void modelColumnsAdded(QModelIndex parent, int start, int end);
54 void modelColumnsAdded(QModelIndex parent, int start, int end);
56 void modelColumnsRemoved(QModelIndex parent, int start, int end);
55 void modelColumnsRemoved(QModelIndex parent, int start, int end);
57 void handleModelDestroyed();
56 void handleModelDestroyed();
58
57
59 // for the series
58 // for the series
60 void barSetsAdded(QList<QBarSet*> sets);
59 void barSetsAdded(QList<QBarSet*> sets);
61 void barSetsRemoved(QList<QBarSet*> sets);
60 void barSetsRemoved(QList<QBarSet*> sets);
62 void valuesAdded(int index, int count);
61 void valuesAdded(int index, int count);
63 void valuesRemoved(int index, int count);
62 void valuesRemoved(int index, int count);
64 void barLabelChanged();
63 void barLabelChanged();
65 void barValueChanged(int index);
64 void barValueChanged(int index);
66 void handleSeriesDestroyed();
65 void handleSeriesDestroyed();
67
66
68 void initializeBarFromModel();
67 void initializeBarFromModel();
69
68
70 private:
69 private:
71 QBarSet* barSet(QModelIndex index);
70 QBarSet* barSet(QModelIndex index);
72 QModelIndex barModelIndex(int barSection, int posInBar);
71 QModelIndex barModelIndex(int barSection, int posInBar);
73 void insertData(int start, int end);
72 void insertData(int start, int end);
74 void removeData(int start, int end);
73 void removeData(int start, int end);
75 void blockModelSignals(bool block = true);
74 void blockModelSignals(bool block = true);
76 void blockSeriesSignals(bool block = true);
75 void blockSeriesSignals(bool block = true);
77
76
78 private:
77 private:
79 QAbstractBarSeries *m_series;
78 QAbstractBarSeries *m_series;
80 QList<QBarSet*> m_barSets;
79 QList<QBarSet*> m_barSets;
81 QAbstractItemModel *m_model;
80 QAbstractItemModel *m_model;
82 int m_first;
81 int m_first;
83 int m_count;
82 int m_count;
84 Qt::Orientation m_orientation;
83 Qt::Orientation m_orientation;
85 int m_firstBarSetSection;
84 int m_firstBarSetSection;
86 int m_lastBarSetSection;
85 int m_lastBarSetSection;
87 bool m_seriesSignalsBlock;
86 bool m_seriesSignalsBlock;
88 bool m_modelSignalsBlock;
87 bool m_modelSignalsBlock;
89
88
90 private:
89 private:
91 QBarModelMapper *q_ptr;
90 QBarModelMapper *q_ptr;
92 Q_DECLARE_PUBLIC(QBarModelMapper)
91 Q_DECLARE_PUBLIC(QBarModelMapper)
93 };
92 };
94
93
95 QTCOMMERCIALCHART_END_NAMESPACE
94 QTCOMMERCIALCHART_END_NAMESPACE
96
95
97 #endif // QBARMODELMAPPER_P_H
96 #endif // QBARMODELMAPPER_P_H
@@ -1,69 +1,69
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #ifndef QPIEMODELMAPPER_H
21 #ifndef QPIEMODELMAPPER_H
22 #define QPIEMODELMAPPER_H
22 #define QPIEMODELMAPPER_H
23
23
24 #include "qchartglobal.h"
24 #include "qchartglobal.h"
25 #include <QObject>
25 #include <QObject>
26
26
27 class QAbstractItemModel;
27 class QAbstractItemModel;
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 class QPieModelMapperPrivate;
31 class QPieModelMapperPrivate;
32 class QPieSeries;
32 class QPieSeries;
33
33
34 class QTCOMMERCIALCHART_EXPORT QPieModelMapper : public QObject
34 class QTCOMMERCIALCHART_EXPORT QPieModelMapper : public QObject
35 {
35 {
36 Q_OBJECT
36 Q_OBJECT
37
37
38 protected:
38 protected:
39 QPieModelMapper(QObject *parent = 0);
39 explicit QPieModelMapper(QObject *parent = 0);
40
40
41 QAbstractItemModel* model() const;
41 QAbstractItemModel* model() const;
42 void setModel(QAbstractItemModel *model);
42 void setModel(QAbstractItemModel *model);
43
43
44 QPieSeries* series() const;
44 QPieSeries* series() const;
45 void setSeries(QPieSeries *series);
45 void setSeries(QPieSeries *series);
46
46
47 int first() const;
47 int first() const;
48 void setFirst(int first);
48 void setFirst(int first);
49
49
50 int count() const;
50 int count() const;
51 void setCount(int count);
51 void setCount(int count);
52
52
53 int valuesSection() const;
53 int valuesSection() const;
54 void setValuesSection(int valuesSection);
54 void setValuesSection(int valuesSection);
55
55
56 int labelsSection() const;
56 int labelsSection() const;
57 void setLabelsSection(int labelsSection);
57 void setLabelsSection(int labelsSection);
58
58
59 Qt::Orientation orientation() const;
59 Qt::Orientation orientation() const;
60 void setOrientation(Qt::Orientation orientation);
60 void setOrientation(Qt::Orientation orientation);
61
61
62 protected:
62 protected:
63 QPieModelMapperPrivate * const d_ptr;
63 QPieModelMapperPrivate * const d_ptr;
64 Q_DECLARE_PRIVATE(QPieModelMapper)
64 Q_DECLARE_PRIVATE(QPieModelMapper)
65 };
65 };
66
66
67 QTCOMMERCIALCHART_END_NAMESPACE
67 QTCOMMERCIALCHART_END_NAMESPACE
68
68
69 #endif // QPIEMODELMAPPER_H
69 #endif // QPIEMODELMAPPER_H
@@ -1,103 +1,99
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 // W A R N I N G
21 // W A R N I N G
22 // -------------
22 // -------------
23 //
23 //
24 // This file is not part of the QtCommercial Chart API. It exists purely as an
24 // This file is not part of the QtCommercial Chart API. It exists purely as an
25 // implementation detail. This header file may change from version to
25 // implementation detail. This header file may change from version to
26 // version without notice, or even be removed.
26 // version without notice, or even be removed.
27 //
27 //
28 // We mean it.
28 // We mean it.
29
29
30 #ifndef QPIEMODELMAPPER_P_H
30 #ifndef QPIEMODELMAPPER_P_H
31 #define QPIEMODELMAPPER_P_H
31 #define QPIEMODELMAPPER_P_H
32
32
33 #include "qpiemodelmapper.h"
34 #include <QObject>
33 #include <QObject>
34 #include "qpiemodelmapper.h"
35
35
36 class QModelIndex;
36 class QModelIndex;
37 class QAbstractItemModel;
38
37
39 QTCOMMERCIALCHART_BEGIN_NAMESPACE
38 QTCOMMERCIALCHART_BEGIN_NAMESPACE
40
39
41 class QPieModelMapper;
42 class QPieSeries;
43 class QPieSlice;
40 class QPieSlice;
44
41
45 class QPieModelMapperPrivate : public QObject
42 class QPieModelMapperPrivate : public QObject
46 {
43 {
47 Q_OBJECT
44 Q_OBJECT
48
45
49 public:
46 public:
50 QPieModelMapperPrivate(QPieModelMapper *q);
47 explicit QPieModelMapperPrivate(QPieModelMapper *q);
51
48
52 public Q_SLOTS:
49 public Q_SLOTS:
53 // for the model
50 // for the model
54 void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight);
51 void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight);
55 void modelRowsAdded(QModelIndex parent, int start, int end);
52 void modelRowsAdded(QModelIndex parent, int start, int end);
56 void modelRowsRemoved(QModelIndex parent, int start, int end);
53 void modelRowsRemoved(QModelIndex parent, int start, int end);
57 void modelColumnsAdded(QModelIndex parent, int start, int end);
54 void modelColumnsAdded(QModelIndex parent, int start, int end);
58 void modelColumnsRemoved(QModelIndex parent, int start, int end);
55 void modelColumnsRemoved(QModelIndex parent, int start, int end);
59 void handleModelDestroyed();
56 void handleModelDestroyed();
60
57
61 // for the series
58 // for the series
62 void slicesAdded(QList<QPieSlice*> slices);
59 void slicesAdded(QList<QPieSlice*> slices);
63 void slicesRemoved(QList<QPieSlice*> slices);
60 void slicesRemoved(QList<QPieSlice*> slices);
64 void sliceLabelChanged();
61 void sliceLabelChanged();
65 void sliceValueChanged();
62 void sliceValueChanged();
66 void handleSeriesDestroyed();
63 void handleSeriesDestroyed();
67
64
68 void initializePieFromModel();
65 void initializePieFromModel();
69
66
70 private:
67 private:
71 QPieSlice* pieSlice(QModelIndex index) const;
68 QPieSlice* pieSlice(QModelIndex index) const;
72 bool isLabelIndex(QModelIndex index) const;
69 bool isLabelIndex(QModelIndex index) const;
73 bool isValueIndex(QModelIndex index) const;
70 bool isValueIndex(QModelIndex index) const;
74 QModelIndex valueModelIndex(int slicePos);
71 QModelIndex valueModelIndex(int slicePos);
75 QModelIndex labelModelIndex(int slicePos);
72 QModelIndex labelModelIndex(int slicePos);
76 void insertData(int start, int end);
73 void insertData(int start, int end);
77 void removeData(int start, int end);
74 void removeData(int start, int end);
78
75
79 void blockModelSignals(bool block = true);
76 void blockModelSignals(bool block = true);
80 void blockSeriesSignals(bool block = true);
77 void blockSeriesSignals(bool block = true);
81
78
82 private:
79 private:
83 QPieSeries *m_series;
80 QPieSeries *m_series;
84 QList<QPieSlice*> m_slices;
81 QList<QPieSlice*> m_slices;
85 QAbstractItemModel *m_model;
82 QAbstractItemModel *m_model;
86 int m_first;
83 int m_first;
87 int m_count;
84 int m_count;
88 Qt::Orientation m_orientation;
85 Qt::Orientation m_orientation;
89 int m_valuesSection;
86 int m_valuesSection;
90 int m_labelsSection;
87 int m_labelsSection;
91 bool m_seriesSignalsBlock;
88 bool m_seriesSignalsBlock;
92 bool m_modelSignalsBlock;
89 bool m_modelSignalsBlock;
93
90
94 private:
91 private:
95
92
96 QPieModelMapper *q_ptr;
93 QPieModelMapper *q_ptr;
97 Q_DECLARE_PUBLIC(QPieModelMapper)
94 Q_DECLARE_PUBLIC(QPieModelMapper)
98 friend class QPieSeriesPrivate;
99 };
95 };
100
96
101 QTCOMMERCIALCHART_END_NAMESPACE
97 QTCOMMERCIALCHART_END_NAMESPACE
102
98
103 #endif // QPIEMODELMAPPER_P_H
99 #endif // QPIEMODELMAPPER_P_H
General Comments 0
You need to be logged in to leave comments. Login now