##// END OF EJS Templates
Areaseries uses new legendmarkers
sauimone -
r2177:3de587f7271d
parent child
Show More
@@ -28,6 +28,8
28 28 #include "charttheme_p.h"
29 29 #include "qvalueaxis.h"
30 30
31 #include "qarealegendmarker.h"
32
31 33 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32 34
33 35 /*!
@@ -384,12 +386,9 QList<LegendMarker *> QAreaSeriesPrivate::createLegendMarker(QLegend *legend)
384 386
385 387 QList<QLegendMarker*> QAreaSeriesPrivate::createLegendMarkers(QLegend* legend)
386 388 {
387 Q_UNUSED(legend);
388 // Q_Q(QAreaSeries);
389 Q_Q(QAreaSeries);
389 390 QList<QLegendMarker*> list;
390 // TODO:
391 // return list << new AreaLegendMarker(q,legend);
392 return list;
391 return list << new QAreaLegendMarker(q,legend);
393 392 }
394 393
395 394 void QAreaSeriesPrivate::initializeAxis(QAbstractAxis *axis)
@@ -62,6 +62,7 QAreaLegendMarkerPrivate::QAreaLegendMarkerPrivate(QAreaLegendMarker *q, QAreaSe
62 62 QLegendMarkerPrivate(q,legend),
63 63 m_series(series)
64 64 {
65 qDebug() << "QAreaLegendMarkerPrivate created";
65 66 QObject::connect(m_series->d_func(),SIGNAL(updated()), this, SLOT(updated()));
66 67 QObject::connect(m_series, SIGNAL(nameChanged()), this, SLOT(updated()));
67 68 updated();
@@ -75,6 +76,7 QAreaLegendMarkerPrivate::~QAreaLegendMarkerPrivate()
75 76
76 77 void QAreaLegendMarkerPrivate::updated()
77 78 {
79 qDebug() << "QAreaLegendMarkerPrivate::updated";
78 80 m_item->setBrush(m_series->brush());
79 81 m_item->setLabel(m_series->name());
80 82 }
@@ -511,14 +511,13 void QLegendPrivate::appendSeries(QAbstractSeries* series)
511 511 QObject::connect(s, SIGNAL(countChanged()), this, SLOT(handleSeriesUpdated()));
512 512 break;
513 513 }
514 // TODO:
515 514 case QAbstractSeries::SeriesTypeLine:
516 515 case QAbstractSeries::SeriesTypeArea:
517 516 case QAbstractSeries::SeriesTypeScatter:
518 517 case QAbstractSeries::SeriesTypeSpline:
519 518 default: {
520 // No need to connect any series related signals?
521 qDebug() << "Not yet implemented";
519 // No need to connect any series related signals. We have no series level
520 // changes, that would generate or delete markers
522 521 }
523 522 }
524 523
@@ -567,7 +566,7 void QLegendPrivate::removeSeries(QAbstractSeries* series)
567 566 case QAbstractSeries::SeriesTypeScatter:
568 567 case QAbstractSeries::SeriesTypeSpline:
569 568 default: {
570 // No need to disconnect any series related signals?
569 // No need to disconnect any series related signals
571 570 break;
572 571 }
573 572 }
@@ -610,7 +609,7 void QLegendPrivate::handleSeriesVisibleChanged()
610 609 void QLegendPrivate::handleCountChanged()
611 610 {
612 611 // TODO: With new markers, the series should notify markers directly.
613 // TODO: Better way to handle updates
612 // TODO: Better way to handle updates. Remove/Add series again seems like overkill.
614 613
615 614 QAbstractSeries *series = qobject_cast<QAbstractSeries *> (sender());
616 615 qDebug() << "QLegendPrivate::handleSeriesUpdated" << series;
General Comments 0
You need to be logged in to leave comments. Login now