##// END OF EJS Templates
remove unnecessary stuff from pie series
Jani Honkonen -
r620:51f99c2be375
parent child
Show More
@@ -4,90 +4,6
4
4
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
6
6
7
8 /*!
9 \class QPieSeries::ChangeSet
10 \brief Defines the changes in the series.
11
12 Contains the changes that have occurred in the series. Lists of added, changed and removed slices.
13
14 \sa QPieSeries::changed()
15 */
16
17 /*!
18 \internal
19 */
20 void QPieSeries::ChangeSet::appendAdded(QPieSlice* slice)
21 {
22 if (!m_added.contains(slice))
23 m_added << slice;
24 }
25
26 /*!
27 \internal
28 */
29 void QPieSeries::ChangeSet::appendAdded(QList<QPieSlice*> slices)
30 {
31 foreach (QPieSlice* s, slices)
32 appendAdded(s);
33 }
34
35 /*!
36 \internal
37 */
38 void QPieSeries::ChangeSet::appendChanged(QPieSlice* slice)
39 {
40 if (!m_changed.contains(slice))
41 m_changed << slice;
42 }
43
44 /*!
45 \internal
46 */
47 void QPieSeries::ChangeSet::appendRemoved(QPieSlice* slice)
48 {
49 if (!m_removed.contains(slice))
50 m_removed << slice;
51 }
52
53 /*!
54 Returns a list of slices that have been added to the series.
55 \sa QPieSeries::changed()
56 */
57 QList<QPieSlice*> QPieSeries::ChangeSet::added() const
58 {
59 return m_added;
60 }
61
62 /*!
63 Returns a list of slices that have been changed in the series.
64 \sa QPieSeries::changed()
65 */
66 QList<QPieSlice*> QPieSeries::ChangeSet::changed() const
67 {
68 return m_changed;
69 }
70
71 /*!
72 Returns a list of slices that have been removed from the series.
73 \sa QPieSeries::changed()
74 */
75 QList<QPieSlice*> QPieSeries::ChangeSet::removed() const
76 {
77 return m_removed;
78 }
79
80
81 /*!
82 Returns true if there are no added/changed or removed slices in the change set.
83 */
84 bool QPieSeries::ChangeSet::isEmpty() const
85 {
86 if (m_added.count() || m_changed.count() || m_removed.count())
87 return false;
88 return true;
89 }
90
91 /*!
7 /*!
92 \class QPieSeries
8 \class QPieSeries
93 \brief Pie series API for QtCommercial Charts
9 \brief Pie series API for QtCommercial Charts
@@ -3,16 +3,8
3
3
4 #include "qseries.h"
4 #include "qseries.h"
5 #include <QObject>
5 #include <QObject>
6 #include <QRectF>
7 #include <QColor>
8 #include <QPen>
9 #include <QBrush>
10 #include <QSignalMapper>
11
6
12 class QGraphicsObject;
13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
14 class PieChartItem;
15 class PieSlice;
16 class QPieSlice;
8 class QPieSlice;
17
9
18 class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries
10 class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries
@@ -20,30 +12,6 class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries
20 Q_OBJECT
12 Q_OBJECT
21
13
22 public:
14 public:
23
24 class ChangeSet
25 {
26 public:
27
28 // TODO: these should not really be exposed to the public API
29 void appendAdded(QPieSlice* slice);
30 void appendAdded(QList<QPieSlice*> slices);
31 void appendChanged(QPieSlice* slice);
32 void appendRemoved(QPieSlice* slice);
33
34 QList<QPieSlice*> added() const;
35 QList<QPieSlice*> changed() const;
36 QList<QPieSlice*> removed() const;
37
38 bool isEmpty() const;
39
40 private:
41 QList<QPieSlice*> m_added;
42 QList<QPieSlice*> m_changed;
43 QList<QPieSlice*> m_removed;
44 };
45
46 public:
47 QPieSeries(QObject *parent = 0);
15 QPieSeries(QObject *parent = 0);
48 virtual ~QPieSeries();
16 virtual ~QPieSeries();
49
17
General Comments 0
You need to be logged in to leave comments. Login now