##// END OF EJS Templates
Bugfix for handleMarkerDestroyed(), removing it
Michal Klocek -
r870:80b01df748b7
parent child
Show More
@@ -290,7 +290,6 void QLegend::handleAdded(QList<QPieSlice *> slices)
290 QPieSeries* series = static_cast<QPieSeries *> (sender());
290 QPieSeries* series = static_cast<QPieSeries *> (sender());
291 foreach(QPieSlice* slice, slices) {
291 foreach(QPieSlice* slice, slices) {
292 PieLegendMarker* marker = new PieLegendMarker(series,slice, this);
292 PieLegendMarker* marker = new PieLegendMarker(series,slice, this);
293 connect(marker, SIGNAL(destroyed()), this, SLOT(handleMarkerDestroyed()));
294 m_markers->addToGroup(marker);
293 m_markers->addToGroup(marker);
295 }
294 }
296 updateLayout();
295 updateLayout();
@@ -305,17 +304,6 void QLegend::handleRemoved(QList<QPieSlice *> slices)
305 Q_UNUSED(slices)
304 Q_UNUSED(slices)
306 }
305 }
307
306
308
309 /*!
310 \internal Notifies legend that some marker has been removed. Sent by legend markers when destroyed
311 */
312 void QLegend::handleMarkerDestroyed()
313 {
314 LegendMarker* m = static_cast<LegendMarker *> (sender());
315 delete m;
316 // updateLayout();
317 }
318
319 /*!
307 /*!
320 Detaches the legend from chart. Chart won't change layout of the legend.
308 Detaches the legend from chart. Chart won't change layout of the legend.
321 */
309 */
@@ -346,7 +334,6 bool QLegend::isAttachedToChart()
346 void QLegend::appendMarkers(QAreaSeries* series)
334 void QLegend::appendMarkers(QAreaSeries* series)
347 {
335 {
348 AreaLegendMarker* marker = new AreaLegendMarker(series,this);
336 AreaLegendMarker* marker = new AreaLegendMarker(series,this);
349 connect(marker, SIGNAL(destroyed()), this, SLOT(handleMarkerDestroyed()));
350 m_markers->addToGroup(marker);
337 m_markers->addToGroup(marker);
351 }
338 }
352
339
@@ -356,7 +343,6 void QLegend::appendMarkers(QAreaSeries* series)
356 void QLegend::appendMarkers(QXYSeries* series)
343 void QLegend::appendMarkers(QXYSeries* series)
357 {
344 {
358 XYLegendMarker* marker = new XYLegendMarker(series,this);
345 XYLegendMarker* marker = new XYLegendMarker(series,this);
359 connect(marker, SIGNAL(destroyed()), this, SLOT(handleMarkerDestroyed()));
360 m_markers->addToGroup(marker);
346 m_markers->addToGroup(marker);
361 }
347 }
362
348
@@ -367,7 +353,6 void QLegend::appendMarkers(QBarSeries *series)
367 {
353 {
368 foreach(QBarSet* set, series->barSets()) {
354 foreach(QBarSet* set, series->barSets()) {
369 BarLegendMarker* marker = new BarLegendMarker(series,set, this);
355 BarLegendMarker* marker = new BarLegendMarker(series,set, this);
370 connect(marker, SIGNAL(destroyed()), this, SLOT(handleMarkerDestroyed()));
371 m_markers->addToGroup(marker);
356 m_markers->addToGroup(marker);
372 }
357 }
373 }
358 }
@@ -379,7 +364,6 void QLegend::appendMarkers(QPieSeries *series)
379 {
364 {
380 foreach(QPieSlice* slice, series->slices()) {
365 foreach(QPieSlice* slice, series->slices()) {
381 PieLegendMarker* marker = new PieLegendMarker(series,slice, this);
366 PieLegendMarker* marker = new PieLegendMarker(series,slice, this);
382 connect(marker, SIGNAL(destroyed()), this, SLOT(handleMarkerDestroyed()));
383 m_markers->addToGroup(marker);
367 m_markers->addToGroup(marker);
384 }
368 }
385 }
369 }
@@ -393,8 +377,8 void QLegend::deleteMarkers(QSeries *series)
393
377
394 QList<QGraphicsItem *> items = m_markers->childItems();
378 QList<QGraphicsItem *> items = m_markers->childItems();
395
379
396 foreach (QGraphicsItem *m, items) {
380 foreach (QGraphicsItem *markers, items) {
397 LegendMarker *marker = static_cast<LegendMarker*>(m);
381 LegendMarker *marker = static_cast<LegendMarker*>(markers);
398 if (marker->series() == series) {
382 if (marker->series() == series) {
399 delete marker;
383 delete marker;
400 }
384 }
@@ -97,8 +97,6 public Q_SLOTS:
97 void handleSeriesRemoved(QSeries *series);
97 void handleSeriesRemoved(QSeries *series);
98 void handleAdded(QList<QPieSlice *> slices);
98 void handleAdded(QList<QPieSlice *> slices);
99 void handleRemoved(QList<QPieSlice *> slices);
99 void handleRemoved(QList<QPieSlice *> slices);
100 void handleMarkerDestroyed();
101
102 // PIMPL <---
100 // PIMPL <---
103
101
104 private:
102 private:
General Comments 0
You need to be logged in to leave comments. Login now