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