@@ -1,142 +1,134 | |||||
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 | #include "qabstractseries.h" |
|
21 | #include "qabstractseries.h" | |
22 | #include "qabstractseries_p.h" |
|
22 | #include "qabstractseries_p.h" | |
23 | #include "chartdataset_p.h" |
|
23 | #include "chartdataset_p.h" | |
24 |
|
24 | |||
25 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
25 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
26 |
|
26 | |||
27 | /*! |
|
27 | /*! | |
28 | \class QAbstractSeries |
|
28 | \class QAbstractSeries | |
29 | \brief Base class for all QtCommercial Chart series. |
|
29 | \brief Base class for all QtCommercial Chart series. | |
30 | \mainclass |
|
30 | \mainclass | |
31 |
|
31 | |||
32 | Usually you use the series type specific inherited classes instead of the base class. |
|
32 | Usually you use the series type specific inherited classes instead of the base class. | |
33 | \sa QXYSeries, QLineSeries, QSplineSeries, QScatterSeries, QAreaSeries, QBarSeries, QStackedBarSeries, |
|
33 | \sa QXYSeries, QLineSeries, QSplineSeries, QScatterSeries, QAreaSeries, QBarSeries, QStackedBarSeries, | |
34 | QPercentBarSeries, QPieSeries |
|
34 | QPercentBarSeries, QPieSeries | |
35 | */ |
|
35 | */ | |
36 |
|
36 | |||
37 | /*! |
|
37 | /*! | |
38 | \enum QAbstractSeries::SeriesType |
|
38 | \enum QAbstractSeries::SeriesType | |
39 |
|
39 | |||
40 | The type of the series object. |
|
40 | The type of the series object. | |
41 |
|
41 | |||
42 | \value SeriesTypeLine |
|
42 | \value SeriesTypeLine | |
43 | \value SeriesTypeArea |
|
43 | \value SeriesTypeArea | |
44 | \value SeriesTypeBar |
|
44 | \value SeriesTypeBar | |
45 | \value SeriesTypeStackedBar |
|
45 | \value SeriesTypeStackedBar | |
46 | \value SeriesTypePercentBar |
|
46 | \value SeriesTypePercentBar | |
47 | \value SeriesTypeGroupedBar |
|
47 | \value SeriesTypeGroupedBar | |
48 | \value SeriesTypePie |
|
48 | \value SeriesTypePie | |
49 | \value SeriesTypeScatter |
|
49 | \value SeriesTypeScatter | |
50 | \value SeriesTypeSpline |
|
50 | \value SeriesTypeSpline | |
51 | */ |
|
51 | */ | |
52 |
|
52 | |||
53 | /*! |
|
53 | /*! | |
54 | \fn QSeriesType QAbstractSeries::type() const |
|
54 | \fn QSeriesType QAbstractSeries::type() const | |
55 | \brief The type of the series. |
|
55 | \brief The type of the series. | |
56 | */ |
|
56 | */ | |
57 |
|
57 | |||
58 | /*! |
|
58 | /*! | |
59 | \fn bool QAbstractSeries::setModel(QAbstractItemModel *model) |
|
|||
60 | \brief Use the \a model to provide data for the series. The model overrides possible user data |
|
|||
61 | set with QChartSeries type specific data setters. For example if you call both |
|
|||
62 | QScatterSeries::addData() and QScatterSeries::setModel, only the data provided by the model is |
|
|||
63 | used by the series. Returns true if the model is valid for the series. |
|
|||
64 | */ |
|
|||
65 |
|
||||
66 | /*! |
|
|||
67 | \property QAbstractSeries::name |
|
59 | \property QAbstractSeries::name | |
68 | \brief name of the series property |
|
60 | \brief name of the series property | |
69 | */ |
|
61 | */ | |
70 |
|
62 | |||
71 | /*! |
|
63 | /*! | |
72 | \fn void QAbstractSeries::setName(const QString& name) |
|
64 | \fn void QAbstractSeries::setName(const QString& name) | |
73 | \brief Sets a \a name for the series. |
|
65 | \brief Sets a \a name for the series. | |
74 |
|
66 | |||
75 | The name of a series is shown in the legend for QXYSeries. |
|
67 | The name of a series is shown in the legend for QXYSeries. | |
76 | \sa QChart::setTitle() |
|
68 | \sa QChart::setTitle() | |
77 | \sa QPieSlice::setLabel() |
|
69 | \sa QPieSlice::setLabel() | |
78 | \sa QBarSet::setName() |
|
70 | \sa QBarSet::setName() | |
79 | */ |
|
71 | */ | |
80 |
|
72 | |||
81 | /*! |
|
73 | /*! | |
82 | \internal |
|
74 | \internal | |
83 | \brief Constructs ChartSeries object with \a parent. |
|
75 | \brief Constructs ChartSeries object with \a parent. | |
84 | */ |
|
76 | */ | |
85 | QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) : |
|
77 | QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) : | |
86 | QObject(parent), |
|
78 | QObject(parent), | |
87 | d_ptr(&d) |
|
79 | d_ptr(&d) | |
88 | { |
|
80 | { | |
89 | } |
|
81 | } | |
90 |
|
82 | |||
91 | /*! |
|
83 | /*! | |
92 | \brief Virtual destructor for the chart series. |
|
84 | \brief Virtual destructor for the chart series. | |
93 | */ |
|
85 | */ | |
94 | QAbstractSeries::~QAbstractSeries() |
|
86 | QAbstractSeries::~QAbstractSeries() | |
95 | { |
|
87 | { | |
96 | if(d_ptr->m_dataset) qFatal("Still binded series detected !"); |
|
88 | if(d_ptr->m_dataset) qFatal("Still binded series detected !"); | |
97 | } |
|
89 | } | |
98 |
|
90 | |||
99 | void QAbstractSeries::setName(const QString& name) |
|
91 | void QAbstractSeries::setName(const QString& name) | |
100 | { |
|
92 | { | |
101 | d_ptr->m_name = name; |
|
93 | d_ptr->m_name = name; | |
102 | } |
|
94 | } | |
103 |
|
95 | |||
104 | /*! |
|
96 | /*! | |
105 | \brief Returns the name of the series. |
|
97 | \brief Returns the name of the series. | |
106 | \sa setName() |
|
98 | \sa setName() | |
107 | */ |
|
99 | */ | |
108 | QString QAbstractSeries::name() const |
|
100 | QString QAbstractSeries::name() const | |
109 | { |
|
101 | { | |
110 | return d_ptr->m_name; |
|
102 | return d_ptr->m_name; | |
111 | } |
|
103 | } | |
112 |
|
104 | |||
113 | /*! |
|
105 | /*! | |
114 | \brief Returns the chart where series belongs to. |
|
106 | \brief Returns the chart where series belongs to. | |
115 |
|
107 | |||
116 | Set automatically when the series is added to the chart |
|
108 | Set automatically when the series is added to the chart | |
117 | and unset when the series is removed from the chart. |
|
109 | and unset when the series is removed from the chart. | |
118 | */ |
|
110 | */ | |
119 | QChart* QAbstractSeries::chart() const |
|
111 | QChart* QAbstractSeries::chart() const | |
120 | { |
|
112 | { | |
121 | return d_ptr->m_chart; |
|
113 | return d_ptr->m_chart; | |
122 | } |
|
114 | } | |
123 |
|
115 | |||
124 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
|
116 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
125 |
|
117 | |||
126 | QAbstractSeriesPrivate::QAbstractSeriesPrivate(QAbstractSeries* q): |
|
118 | QAbstractSeriesPrivate::QAbstractSeriesPrivate(QAbstractSeries* q): | |
127 | q_ptr(q), |
|
119 | q_ptr(q), | |
128 | m_chart(0), |
|
120 | m_chart(0), | |
129 | m_dataset(0) |
|
121 | m_dataset(0) | |
130 | { |
|
122 | { | |
131 | } |
|
123 | } | |
132 |
|
124 | |||
133 | QAbstractSeriesPrivate::~QAbstractSeriesPrivate() |
|
125 | QAbstractSeriesPrivate::~QAbstractSeriesPrivate() | |
134 | { |
|
126 | { | |
135 | } |
|
127 | } | |
136 |
|
128 | |||
137 | #include "moc_qabstractseries.cpp" |
|
129 | #include "moc_qabstractseries.cpp" | |
138 | #include "moc_qabstractseries_p.cpp" |
|
130 | #include "moc_qabstractseries_p.cpp" | |
139 |
|
131 | |||
140 | QTCOMMERCIALCHART_END_NAMESPACE |
|
132 | QTCOMMERCIALCHART_END_NAMESPACE | |
141 |
|
133 | |||
142 |
|
134 |
General Comments 0
You need to be logged in to leave comments.
Login now