@@ -213,6 +213,7 void ChartTheme::decorate(QScatterSeries* series, int index,bool force) | |||||
213 |
|
213 | |||
214 | void ChartTheme::decorate(QPieSeries* series, int index, bool force) |
|
214 | void ChartTheme::decorate(QPieSeries* series, int index, bool force) | |
215 | { |
|
215 | { | |
|
216 | ||||
216 | for (int i(0); i < series->slices().count(); i++) { |
|
217 | for (int i(0); i < series->slices().count(); i++) { | |
217 |
|
218 | |||
218 | QColor penColor = colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 0.0); |
|
219 | QColor penColor = colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 0.0); | |
@@ -221,8 +222,8 void ChartTheme::decorate(QPieSeries* series, int index, bool force) | |||||
221 | qreal pos = (qreal) (i + 1) / (qreal) series->count(); |
|
222 | qreal pos = (qreal) (i + 1) / (qreal) series->count(); | |
222 | QColor brushColor = colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), pos); |
|
223 | QColor brushColor = colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), pos); | |
223 |
|
224 | |||
224 |
QPieSlice |
|
225 | QPieSlice *s = series->slices().at(i); | |
225 |
PieSliceData data = s-> |
|
226 | PieSliceData data = *s->data_ptr(); | |
226 |
|
227 | |||
227 | if (data.m_slicePen.isThemed() || force) { |
|
228 | if (data.m_slicePen.isThemed() || force) { | |
228 | data.m_slicePen = penColor; |
|
229 | data.m_slicePen = penColor; | |
@@ -244,9 +245,9 void ChartTheme::decorate(QPieSeries* series, int index, bool force) | |||||
244 | data.m_labelFont.setThemed(true); |
|
245 | data.m_labelFont.setThemed(true); | |
245 | } |
|
246 | } | |
246 |
|
247 | |||
247 |
if (s-> |
|
248 | if (*s->data_ptr() != data) { | |
248 |
s-> |
|
249 | *s->data_ptr() = data; | |
249 |
emit s-> |
|
250 | emit s->data_ptr()->emitChangedSignal(s); | |
250 | } |
|
251 | } | |
251 | } |
|
252 | } | |
252 | } |
|
253 | } |
@@ -11,7 +11,6 PRIVATE_HEADERS += \ | |||||
11 | $$PWD/pieslicedata_p.h \ |
|
11 | $$PWD/pieslicedata_p.h \ | |
12 | $$PWD/piechartitem_p.h \ |
|
12 | $$PWD/piechartitem_p.h \ | |
13 | $$PWD/piesliceitem_p.h \ |
|
13 | $$PWD/piesliceitem_p.h \ | |
14 | $$PWD/qpiesliceprivate_p.h \ |
|
|||
15 | $$PWD/qpieseriesprivate_p.h |
|
14 | $$PWD/qpieseriesprivate_p.h | |
16 |
|
15 | |||
17 | PUBLIC_HEADERS += \ |
|
16 | PUBLIC_HEADERS += \ |
@@ -21,7 +21,6 | |||||
21 | #include "piechartitem_p.h" |
|
21 | #include "piechartitem_p.h" | |
22 | #include "piesliceitem_p.h" |
|
22 | #include "piesliceitem_p.h" | |
23 | #include "qpieslice.h" |
|
23 | #include "qpieslice.h" | |
24 | #include "qpiesliceprivate_p.h" |
|
|||
25 | #include "qpieseries.h" |
|
24 | #include "qpieseries.h" | |
26 | #include "chartpresenter_p.h" |
|
25 | #include "chartpresenter_p.h" | |
27 | #include "chartdataset_p.h" |
|
26 | #include "chartdataset_p.h" | |
@@ -147,7 +146,8 void PieChartItem::calculatePieLayout() | |||||
147 |
|
146 | |||
148 | PieSliceData PieChartItem::sliceData(QPieSlice *slice) |
|
147 | PieSliceData PieChartItem::sliceData(QPieSlice *slice) | |
149 | { |
|
148 | { | |
150 | PieSliceData sliceData = slice->data_ptr()->m_data; |
|
149 | // TODO: This function is kid of useless now. Refactor. | |
|
150 | PieSliceData sliceData = *slice->data_ptr(); | |||
151 | sliceData.m_center = PieSliceItem::sliceCenter(m_pieCenter, m_pieRadius, slice); |
|
151 | sliceData.m_center = PieSliceItem::sliceCenter(m_pieCenter, m_pieRadius, slice); | |
152 | sliceData.m_radius = m_pieRadius; |
|
152 | sliceData.m_radius = m_pieRadius; | |
153 | return sliceData; |
|
153 | return sliceData; |
@@ -21,7 +21,8 | |||||
21 | #ifndef PIESLICEDATA_P_H |
|
21 | #ifndef PIESLICEDATA_P_H | |
22 | #define PIESLICEDATA_P_H |
|
22 | #define PIESLICEDATA_P_H | |
23 |
|
23 | |||
24 |
#include |
|
24 | #include "qchartglobal.h" | |
|
25 | #include "qpieslice.h" | |||
25 | #include <QPen> |
|
26 | #include <QPen> | |
26 | #include <QBrush> |
|
27 | #include <QBrush> | |
27 | #include <QDebug> |
|
28 | #include <QDebug> | |
@@ -104,6 +105,11 public: | |||||
104 | return false; |
|
105 | return false; | |
105 | } |
|
106 | } | |
106 |
|
107 | |||
|
108 | void emitChangedSignal(QPieSlice *s) | |||
|
109 | { | |||
|
110 | emit s->changed(); | |||
|
111 | } | |||
|
112 | ||||
107 | qreal m_value; |
|
113 | qreal m_value; | |
108 |
|
114 | |||
109 | Themed<QPen> m_slicePen; |
|
115 | Themed<QPen> m_slicePen; |
@@ -24,7 +24,7 | |||||
24 | #include "qchartglobal.h" |
|
24 | #include "qchartglobal.h" | |
25 | #include "charttheme_p.h" |
|
25 | #include "charttheme_p.h" | |
26 | #include "qpieseries.h" |
|
26 | #include "qpieseries.h" | |
27 |
#include " |
|
27 | #include "pieslicedata_p.h" | |
28 | #include <QGraphicsItem> |
|
28 | #include <QGraphicsItem> | |
29 | #include <QRectF> |
|
29 | #include <QRectF> | |
30 | #include <QColor> |
|
30 | #include <QColor> |
@@ -19,8 +19,9 | |||||
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qpieseries.h" |
|
21 | #include "qpieseries.h" | |
22 | #include "qpiesliceprivate_p.h" |
|
|||
23 | #include "qpieseriesprivate_p.h" |
|
22 | #include "qpieseriesprivate_p.h" | |
|
23 | #include "qpieslice.h" | |||
|
24 | #include "pieslicedata_p.h" | |||
24 | #include <QDebug> |
|
25 | #include <QDebug> | |
25 |
|
26 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
@@ -68,21 +69,21 void QPieSeriesPrivate::updateDerivativeData() | |||||
68 | QVector<QPieSlice*> changed; |
|
69 | QVector<QPieSlice*> changed; | |
69 | foreach (QPieSlice* s, m_slices) { |
|
70 | foreach (QPieSlice* s, m_slices) { | |
70 |
|
71 | |||
71 |
PieSliceData data = s->data_ptr() |
|
72 | PieSliceData data = *s->data_ptr(); | |
72 | data.m_percentage = s->value() / m_total; |
|
73 | data.m_percentage = s->value() / m_total; | |
73 | data.m_angleSpan = pieSpan * data.m_percentage; |
|
74 | data.m_angleSpan = pieSpan * data.m_percentage; | |
74 | data.m_startAngle = sliceAngle; |
|
75 | data.m_startAngle = sliceAngle; | |
75 | sliceAngle += data.m_angleSpan; |
|
76 | sliceAngle += data.m_angleSpan; | |
76 |
|
77 | |||
77 |
if (s->data_ptr() |
|
78 | if (*s->data_ptr() != data) { | |
78 |
s->data_ptr() |
|
79 | *s->data_ptr() = data; | |
79 | changed << s; |
|
80 | changed << s; | |
80 | } |
|
81 | } | |
81 | } |
|
82 | } | |
82 |
|
83 | |||
83 | // emit signals |
|
84 | // emit signals | |
84 | foreach (QPieSlice* s, changed) |
|
85 | foreach (QPieSlice* s, changed) | |
85 |
|
|
86 | s->data_ptr()->emitChangedSignal(s); | |
86 | } |
|
87 | } | |
87 |
|
88 | |||
88 | void QPieSeriesPrivate::sliceChanged() |
|
89 | void QPieSeriesPrivate::sliceChanged() |
@@ -89,10 +89,6 private: | |||||
89 | QPieSeriesPrivate * const d_ptr; |
|
89 | QPieSeriesPrivate * const d_ptr; | |
90 | Q_DECLARE_PRIVATE(QPieSeries) |
|
90 | Q_DECLARE_PRIVATE(QPieSeries) | |
91 | Q_DISABLE_COPY(QPieSeries) |
|
91 | Q_DISABLE_COPY(QPieSeries) | |
92 |
|
||||
93 | public: |
|
|||
94 | typedef QPieSeriesPrivate * const DataPtr; |
|
|||
95 | inline DataPtr &data_ptr() { return d_ptr; } |
|
|||
96 | }; |
|
92 | }; | |
97 |
|
93 | |||
98 | QTCOMMERCIALCHART_END_NAMESPACE |
|
94 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -19,9 +19,7 | |||||
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qpieslice.h" |
|
21 | #include "qpieslice.h" | |
22 |
#include " |
|
22 | #include "pieslicedata_p.h" | |
23 | #include "qpieseries.h" |
|
|||
24 | #include "qpieseriesprivate_p.h" |
|
|||
25 |
|
23 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
24 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
25 | |||
@@ -57,7 +55,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
57 | */ |
|
55 | */ | |
58 | QPieSlice::QPieSlice(QObject *parent) |
|
56 | QPieSlice::QPieSlice(QObject *parent) | |
59 | :QObject(parent), |
|
57 | :QObject(parent), | |
60 |
d |
|
58 | d(new PieSliceData()) | |
61 | { |
|
59 | { | |
62 |
|
60 | |||
63 | } |
|
61 | } | |
@@ -69,11 +67,10 QPieSlice::QPieSlice(QObject *parent) | |||||
69 | */ |
|
67 | */ | |
70 | QPieSlice::QPieSlice(qreal value, QString label, QObject *parent) |
|
68 | QPieSlice::QPieSlice(qreal value, QString label, QObject *parent) | |
71 | :QObject(parent), |
|
69 | :QObject(parent), | |
72 |
d |
|
70 | d(new PieSliceData()) | |
73 | { |
|
71 | { | |
74 | Q_D(QPieSlice); |
|
72 | d->m_value = value; | |
75 | d->m_data.m_value = value; |
|
73 | d->m_labelText = label; | |
76 | d->m_data.m_labelText = label; |
|
|||
77 | } |
|
74 | } | |
78 |
|
75 | |||
79 | /*! |
|
76 | /*! | |
@@ -82,7 +79,7 QPieSlice::QPieSlice(qreal value, QString label, QObject *parent) | |||||
82 | */ |
|
79 | */ | |
83 | QPieSlice::~QPieSlice() |
|
80 | QPieSlice::~QPieSlice() | |
84 | { |
|
81 | { | |
85 |
delete d |
|
82 | delete d; | |
86 | } |
|
83 | } | |
87 |
|
84 | |||
88 | /*! |
|
85 | /*! | |
@@ -92,8 +89,7 QPieSlice::~QPieSlice() | |||||
92 | */ |
|
89 | */ | |
93 | qreal QPieSlice::value() const |
|
90 | qreal QPieSlice::value() const | |
94 | { |
|
91 | { | |
95 | Q_D(const QPieSlice); |
|
92 | return d->m_value; | |
96 | return d->m_data.m_value; |
|
|||
97 | } |
|
93 | } | |
98 |
|
94 | |||
99 | /*! |
|
95 | /*! | |
@@ -101,9 +97,8 qreal QPieSlice::value() const | |||||
101 | \sa setLabel() |
|
97 | \sa setLabel() | |
102 | */ |
|
98 | */ | |
103 | QString QPieSlice::label() const |
|
99 | QString QPieSlice::label() const | |
104 | { |
|
100 | { | |
105 | Q_D(const QPieSlice); |
|
101 | return d->m_labelText; | |
106 | return d->m_data.m_labelText; |
|
|||
107 | } |
|
102 | } | |
108 |
|
103 | |||
109 | /*! |
|
104 | /*! | |
@@ -112,8 +107,7 QString QPieSlice::label() const | |||||
112 | */ |
|
107 | */ | |
113 | bool QPieSlice::isLabelVisible() const |
|
108 | bool QPieSlice::isLabelVisible() const | |
114 | { |
|
109 | { | |
115 | Q_D(const QPieSlice); |
|
110 | return d->m_isLabelVisible; | |
116 | return d->m_data.m_isLabelVisible; |
|
|||
117 | } |
|
111 | } | |
118 |
|
112 | |||
119 | /*! |
|
113 | /*! | |
@@ -122,8 +116,7 bool QPieSlice::isLabelVisible() const | |||||
122 | */ |
|
116 | */ | |
123 | bool QPieSlice::isExploded() const |
|
117 | bool QPieSlice::isExploded() const | |
124 | { |
|
118 | { | |
125 | Q_D(const QPieSlice); |
|
119 | return d->m_isExploded; | |
126 | return d->m_data.m_isExploded; |
|
|||
127 | } |
|
120 | } | |
128 |
|
121 | |||
129 | /*! |
|
122 | /*! | |
@@ -139,8 +132,7 bool QPieSlice::isExploded() const | |||||
139 | */ |
|
132 | */ | |
140 | qreal QPieSlice::explodeDistanceFactor() const |
|
133 | qreal QPieSlice::explodeDistanceFactor() const | |
141 | { |
|
134 | { | |
142 | Q_D(const QPieSlice); |
|
135 | return d->m_explodeDistanceFactor; | |
143 | return d->m_data.m_explodeDistanceFactor; |
|
|||
144 | } |
|
136 | } | |
145 |
|
137 | |||
146 | /*! |
|
138 | /*! | |
@@ -151,8 +143,7 qreal QPieSlice::explodeDistanceFactor() const | |||||
151 | */ |
|
143 | */ | |
152 | qreal QPieSlice::percentage() const |
|
144 | qreal QPieSlice::percentage() const | |
153 | { |
|
145 | { | |
154 | Q_D(const QPieSlice); |
|
146 | return d->m_percentage; | |
155 | return d->m_data.m_percentage; |
|
|||
156 | } |
|
147 | } | |
157 |
|
148 | |||
158 | /*! |
|
149 | /*! | |
@@ -164,8 +155,7 qreal QPieSlice::percentage() const | |||||
164 | */ |
|
155 | */ | |
165 | qreal QPieSlice::startAngle() const |
|
156 | qreal QPieSlice::startAngle() const | |
166 | { |
|
157 | { | |
167 | Q_D(const QPieSlice); |
|
158 | return d->m_startAngle; | |
168 | return d->m_data.m_startAngle; |
|
|||
169 | } |
|
159 | } | |
170 |
|
160 | |||
171 | /*! |
|
161 | /*! | |
@@ -177,8 +167,7 qreal QPieSlice::startAngle() const | |||||
177 | */ |
|
167 | */ | |
178 | qreal QPieSlice::endAngle() const |
|
168 | qreal QPieSlice::endAngle() const | |
179 | { |
|
169 | { | |
180 | Q_D(const QPieSlice); |
|
170 | return d->m_startAngle + d->m_angleSpan; | |
181 | return d->m_data.m_startAngle + d->m_data.m_angleSpan; |
|
|||
182 | } |
|
171 | } | |
183 |
|
172 | |||
184 | /*! |
|
173 | /*! | |
@@ -187,8 +176,7 qreal QPieSlice::endAngle() const | |||||
187 | */ |
|
176 | */ | |
188 | QPen QPieSlice::pen() const |
|
177 | QPen QPieSlice::pen() const | |
189 | { |
|
178 | { | |
190 | Q_D(const QPieSlice); |
|
179 | return d->m_slicePen; | |
191 | return d->m_data.m_slicePen; |
|
|||
192 | } |
|
180 | } | |
193 |
|
181 | |||
194 | /*! |
|
182 | /*! | |
@@ -197,8 +185,7 QPen QPieSlice::pen() const | |||||
197 | */ |
|
185 | */ | |
198 | QBrush QPieSlice::brush() const |
|
186 | QBrush QPieSlice::brush() const | |
199 | { |
|
187 | { | |
200 | Q_D(const QPieSlice); |
|
188 | return d->m_sliceBrush; | |
201 | return d->m_data.m_sliceBrush; |
|
|||
202 | } |
|
189 | } | |
203 |
|
190 | |||
204 | /*! |
|
191 | /*! | |
@@ -207,8 +194,7 QBrush QPieSlice::brush() const | |||||
207 | */ |
|
194 | */ | |
208 | QPen QPieSlice::labelPen() const |
|
195 | QPen QPieSlice::labelPen() const | |
209 | { |
|
196 | { | |
210 | Q_D(const QPieSlice); |
|
197 | return d->m_labelPen; | |
211 | return d->m_data.m_labelPen; |
|
|||
212 | } |
|
198 | } | |
213 |
|
199 | |||
214 | /*! |
|
200 | /*! | |
@@ -217,8 +203,7 QPen QPieSlice::labelPen() const | |||||
217 | */ |
|
203 | */ | |
218 | QFont QPieSlice::labelFont() const |
|
204 | QFont QPieSlice::labelFont() const | |
219 | { |
|
205 | { | |
220 | Q_D(const QPieSlice); |
|
206 | return d->m_labelFont; | |
221 | return d->m_data.m_labelFont; |
|
|||
222 | } |
|
207 | } | |
223 |
|
208 | |||
224 | /*! |
|
209 | /*! | |
@@ -234,8 +219,7 QFont QPieSlice::labelFont() const | |||||
234 | */ |
|
219 | */ | |
235 | qreal QPieSlice::labelArmLengthFactor() const |
|
220 | qreal QPieSlice::labelArmLengthFactor() const | |
236 | { |
|
221 | { | |
237 | Q_D(const QPieSlice); |
|
222 | return d->m_labelArmLengthFactor; | |
238 | return d->m_data.m_labelArmLengthFactor; |
|
|||
239 | } |
|
223 | } | |
240 |
|
224 | |||
241 | /*! |
|
225 | /*! | |
@@ -276,15 +260,9 qreal QPieSlice::labelArmLengthFactor() const | |||||
276 | */ |
|
260 | */ | |
277 | void QPieSlice::setValue(qreal value) |
|
261 | void QPieSlice::setValue(qreal value) | |
278 | { |
|
262 | { | |
279 | Q_D(QPieSlice); |
|
263 | if (!qFuzzyIsNull(d->m_value - value)) { | |
280 | if (!qFuzzyIsNull(d->m_data.m_value - value)) { |
|
264 | d->m_value = value; | |
281 | d->m_data.m_value = value; |
|
265 | emit changed(); | |
282 |
|
||||
283 | QPieSeries *series = qobject_cast<QPieSeries*>(parent()); |
|
|||
284 | if (series) |
|
|||
285 | series->data_ptr()->updateDerivativeData(); // will emit changed() |
|
|||
286 | else |
|
|||
287 | emit changed(); |
|
|||
288 | } |
|
266 | } | |
289 | } |
|
267 | } | |
290 |
|
268 | |||
@@ -294,9 +272,8 void QPieSlice::setValue(qreal value) | |||||
294 | */ |
|
272 | */ | |
295 | void QPieSlice::setLabel(QString label) |
|
273 | void QPieSlice::setLabel(QString label) | |
296 | { |
|
274 | { | |
297 | Q_D(QPieSlice); |
|
275 | if (d->m_labelText != label) { | |
298 |
|
|
276 | d->m_labelText = label; | |
299 | d->m_data.m_labelText = label; |
|
|||
300 | emit changed(); |
|
277 | emit changed(); | |
301 | } |
|
278 | } | |
302 | } |
|
279 | } | |
@@ -307,9 +284,8 void QPieSlice::setLabel(QString label) | |||||
307 | */ |
|
284 | */ | |
308 | void QPieSlice::setLabelVisible(bool visible) |
|
285 | void QPieSlice::setLabelVisible(bool visible) | |
309 | { |
|
286 | { | |
310 | Q_D(QPieSlice); |
|
287 | if (d->m_isLabelVisible != visible) { | |
311 |
|
|
288 | d->m_isLabelVisible = visible; | |
312 | d->m_data.m_isLabelVisible = visible; |
|
|||
313 | emit changed(); |
|
289 | emit changed(); | |
314 | } |
|
290 | } | |
315 | } |
|
291 | } | |
@@ -320,9 +296,8 void QPieSlice::setLabelVisible(bool visible) | |||||
320 | */ |
|
296 | */ | |
321 | void QPieSlice::setExploded(bool exploded) |
|
297 | void QPieSlice::setExploded(bool exploded) | |
322 | { |
|
298 | { | |
323 | Q_D(QPieSlice); |
|
299 | if (d->m_isExploded != exploded) { | |
324 |
|
|
300 | d->m_isExploded = exploded; | |
325 | d->m_data.m_isExploded = exploded; |
|
|||
326 | emit changed(); |
|
301 | emit changed(); | |
327 | } |
|
302 | } | |
328 | } |
|
303 | } | |
@@ -340,9 +315,8 void QPieSlice::setExploded(bool exploded) | |||||
340 | */ |
|
315 | */ | |
341 | void QPieSlice::setExplodeDistanceFactor(qreal factor) |
|
316 | void QPieSlice::setExplodeDistanceFactor(qreal factor) | |
342 | { |
|
317 | { | |
343 | Q_D(QPieSlice); |
|
318 | if (!qFuzzyIsNull(d->m_explodeDistanceFactor - factor)) { | |
344 |
|
|
319 | d->m_explodeDistanceFactor = factor; | |
345 | d->m_data.m_explodeDistanceFactor = factor; |
|
|||
346 | emit changed(); |
|
320 | emit changed(); | |
347 | } |
|
321 | } | |
348 | } |
|
322 | } | |
@@ -354,10 +328,9 void QPieSlice::setExplodeDistanceFactor(qreal factor) | |||||
354 | */ |
|
328 | */ | |
355 | void QPieSlice::setPen(const QPen &pen) |
|
329 | void QPieSlice::setPen(const QPen &pen) | |
356 | { |
|
330 | { | |
357 | Q_D(QPieSlice); |
|
331 | if (d->m_slicePen != pen) { | |
358 |
|
|
332 | d->m_slicePen = pen; | |
359 |
d->m_ |
|
333 | d->m_slicePen.setThemed(false); | |
360 | d->m_data.m_slicePen.setThemed(false); |
|
|||
361 | emit changed(); |
|
334 | emit changed(); | |
362 | } |
|
335 | } | |
363 | } |
|
336 | } | |
@@ -369,10 +342,9 void QPieSlice::setPen(const QPen &pen) | |||||
369 | */ |
|
342 | */ | |
370 | void QPieSlice::setBrush(const QBrush &brush) |
|
343 | void QPieSlice::setBrush(const QBrush &brush) | |
371 | { |
|
344 | { | |
372 | Q_D(QPieSlice); |
|
345 | if (d->m_sliceBrush != brush) { | |
373 |
|
|
346 | d->m_sliceBrush = brush; | |
374 |
d->m_ |
|
347 | d->m_sliceBrush.setThemed(false); | |
375 | d->m_data.m_sliceBrush.setThemed(false); |
|
|||
376 | emit changed(); |
|
348 | emit changed(); | |
377 | } |
|
349 | } | |
378 | } |
|
350 | } | |
@@ -384,10 +356,9 void QPieSlice::setBrush(const QBrush &brush) | |||||
384 | */ |
|
356 | */ | |
385 | void QPieSlice::setLabelPen(const QPen &pen) |
|
357 | void QPieSlice::setLabelPen(const QPen &pen) | |
386 | { |
|
358 | { | |
387 | Q_D(QPieSlice); |
|
359 | if (d->m_labelPen != pen) { | |
388 |
|
|
360 | d->m_labelPen = pen; | |
389 |
d->m_ |
|
361 | d->m_labelPen.setThemed(false); | |
390 | d->m_data.m_labelPen.setThemed(false); |
|
|||
391 | emit changed(); |
|
362 | emit changed(); | |
392 | } |
|
363 | } | |
393 | } |
|
364 | } | |
@@ -399,10 +370,9 void QPieSlice::setLabelPen(const QPen &pen) | |||||
399 | */ |
|
370 | */ | |
400 | void QPieSlice::setLabelFont(const QFont &font) |
|
371 | void QPieSlice::setLabelFont(const QFont &font) | |
401 | { |
|
372 | { | |
402 | Q_D(QPieSlice); |
|
373 | if (d->m_labelFont != font) { | |
403 |
|
|
374 | d->m_labelFont = font; | |
404 |
d->m_ |
|
375 | d->m_labelFont.setThemed(false); | |
405 | d->m_data.m_labelFont.setThemed(false); |
|
|||
406 | emit changed(); |
|
376 | emit changed(); | |
407 | } |
|
377 | } | |
408 | } |
|
378 | } | |
@@ -420,14 +390,12 void QPieSlice::setLabelFont(const QFont &font) | |||||
420 | */ |
|
390 | */ | |
421 | void QPieSlice::setLabelArmLengthFactor(qreal factor) |
|
391 | void QPieSlice::setLabelArmLengthFactor(qreal factor) | |
422 | { |
|
392 | { | |
423 | Q_D(QPieSlice); |
|
393 | if (!qFuzzyIsNull(d->m_labelArmLengthFactor - factor)) { | |
424 |
|
|
394 | d->m_labelArmLengthFactor = factor; | |
425 | d->m_data.m_labelArmLengthFactor = factor; |
|
|||
426 | emit changed(); |
|
395 | emit changed(); | |
427 | } |
|
396 | } | |
428 | } |
|
397 | } | |
429 |
|
398 | |||
430 | #include "moc_qpieslice.cpp" |
|
399 | #include "moc_qpieslice.cpp" | |
431 | #include "moc_qpiesliceprivate_p.cpp" |
|
|||
432 |
|
400 | |||
433 | QTCOMMERCIALCHART_END_NAMESPACE |
|
401 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -28,7 +28,7 | |||||
28 | #include <QFont> |
|
28 | #include <QFont> | |
29 |
|
29 | |||
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
31 |
class |
|
31 | class PieSliceData; | |
32 |
|
32 | |||
33 | class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject |
|
33 | class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject | |
34 | { |
|
34 | { | |
@@ -77,13 +77,13 Q_SIGNALS: | |||||
77 | void changed(); |
|
77 | void changed(); | |
78 |
|
78 | |||
79 | private: |
|
79 | private: | |
80 | QPieSlicePrivate * const d_ptr; |
|
80 | friend class PieSliceData; | |
81 | Q_DECLARE_PRIVATE(QPieSlice) |
|
81 | PieSliceData * const d; | |
82 | Q_DISABLE_COPY(QPieSlice) |
|
82 | Q_DISABLE_COPY(QPieSlice) | |
83 |
|
83 | |||
84 | public: |
|
84 | public: | |
85 |
typedef |
|
85 | typedef PieSliceData * const DataPtr; | |
86 |
inline DataPtr &data_ptr() { return d |
|
86 | inline DataPtr &data_ptr() { return d; } | |
87 | }; |
|
87 | }; | |
88 |
|
88 | |||
89 | QTCOMMERCIALCHART_END_NAMESPACE |
|
89 | QTCOMMERCIALCHART_END_NAMESPACE |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now