qlegend.cpp
514 lines
| 12.8 KiB
| text/x-c
|
CppLexer
Jani Honkonen
|
r794 | /**************************************************************************** | ||
Michal Klocek
|
r950 | ** | ||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
Jani Honkonen
|
r794 | |||
sauimone
|
r524 | #include "qlegend.h" | ||
Michal Klocek
|
r950 | #include "qlegend_p.h" | ||
Tero Ahola
|
r988 | #include "qabstractseries.h" | ||
#include "qabstractseries_p.h" | ||||
Michal Klocek
|
r950 | #include "qchart_p.h" | ||
Michal Klocek
|
r1534 | #include "legendlayout_p.h" | ||
sauimone
|
r547 | #include "legendmarker_p.h" | ||
sauimone
|
r565 | #include "qxyseries.h" | ||
#include "qlineseries.h" | ||||
#include "qareaseries.h" | ||||
#include "qscatterseries.h" | ||||
#include "qsplineseries.h" | ||||
sauimone
|
r1586 | #include "qabstractbarseries.h" | ||
sauimone
|
r565 | #include "qstackedbarseries.h" | ||
#include "qpercentbarseries.h" | ||||
#include "qbarset.h" | ||||
#include "qpieseries.h" | ||||
Jani Honkonen
|
r1009 | #include "qpieseries_p.h" | ||
sauimone
|
r565 | #include "qpieslice.h" | ||
sauimone
|
r626 | #include "chartpresenter_p.h" | ||
Michal Klocek
|
r2105 | #include "chartlayout_p.h" | ||
sauimone
|
r529 | #include <QPainter> | ||
#include <QPen> | ||||
Michal Klocek
|
r855 | #include <QTimer> | ||
sauimone
|
r547 | #include <QGraphicsSceneEvent> | ||
sauimone
|
r529 | |||
sauimone
|
r547 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
sauimone
|
r529 | |||
sauimone
|
r728 | /*! | ||
Tero Ahola
|
r995 | \class QLegend | ||
sauimone
|
r1501 | \brief Legend object | ||
Tero Ahola
|
r995 | \mainclass | ||
sauimone
|
r728 | |||
Tero Ahola
|
r995 | QLegend is a graphical object, whics displays legend of the chart. Legend state is updated by QChart, when | ||
series have been changed. By default, legend is drawn by QChart, but user can set a new parent to legend and | ||||
handle the drawing manually. | ||||
User isn't supposed to create or delete legend objects, but can reference it via QChart class. | ||||
sauimone
|
r728 | |||
Tero Ahola
|
r995 | \image examples_percentbarchart_legend.png | ||
sauimone
|
r728 | |||
Tero Ahola
|
r995 | \sa QChart | ||
*/ | ||||
Tero Ahola
|
r1452 | /*! | ||
\qmlclass Legend QLegend | ||||
\brief Legend is part of QtCommercial Chart QML API. | ||||
Legend is a graphical object, whics displays legend of the chart. Legend state is updated by ChartView, when | ||||
Tero Ahola
|
r1475 | series have been changed. Legend is used via ChartView class. For example: | ||
Tero Ahola
|
r1452 | \code | ||
ChartView { | ||||
legend.visible: true | ||||
legend.alignment: Qt.AlignBottom | ||||
// Add a few series... | ||||
} | ||||
\endcode | ||||
\image examples_percentbarchart_legend.png | ||||
*/ | ||||
/*! | ||||
\property QLegend::alignment | ||||
\brief The alignment of the legend. | ||||
Legend paints on the defined position in the chart. The following alignments are supported: | ||||
Qt::AlignTop, Qt::AlignBottom, Qt::AlignLeft, Qt::AlignRight. If you set more than one flag the result is undefined. | ||||
*/ | ||||
/*! | ||||
\qmlproperty Qt.Alignment Legend::alignment | ||||
\brief The alignment of the legend. | ||||
Legend paints on the defined position in the chart. The following alignments are supported: | ||||
Qt.AlignTop, Qt.AlignBottom, Qt.AlignLeft, Qt.AlignRight. If you set more than one flag the result is undefined. | ||||
*/ | ||||
/*! | ||||
\property QLegend::backgroundVisible | ||||
Whether the legend background is visible or not. | ||||
*/ | ||||
/*! | ||||
\qmlproperty bool Legend::backgroundVisible | ||||
Whether the legend background is visible or not. | ||||
*/ | ||||
/*! | ||||
\property QLegend::color | ||||
Tero Ahola
|
r1472 | The color of the legend, i.e. the background (brush) color. Note that if you change the color | ||
of the legend, the style of the legend brush is set to Qt::SolidPattern. | ||||
Tero Ahola
|
r1452 | */ | ||
/*! | ||||
\qmlproperty color Legend::color | ||||
Tero Ahola
|
r1472 | The color of the legend, i.e. the background (brush) color. | ||
Tero Ahola
|
r1452 | */ | ||
/*! | ||||
\property QLegend::borderColor | ||||
The border color of the legend, i.e. the line color. | ||||
*/ | ||||
/*! | ||||
\qmlproperty color Legend::borderColor | ||||
The border color of the legend, i.e. the line color. | ||||
*/ | ||||
sauimone
|
r728 | |||
sauimone
|
r1522 | /*! | ||
\property QLegend::font | ||||
The font of markers used by legend | ||||
*/ | ||||
/*! | ||||
\qmlproperty color Legend::font | ||||
The font of markers used by legend | ||||
*/ | ||||
Tero Ahola
|
r1529 | /*! | ||
\property QLegend::labelColor | ||||
The color of brush used to draw labels. | ||||
*/ | ||||
/*! | ||||
\qmlproperty color QLegend::labelColor | ||||
The color of brush used to draw labels. | ||||
*/ | ||||
Tero Ahola
|
r1452 | /*! | ||
\fn void QLegend::backgroundVisibleChanged(bool) | ||||
The visibility of the legend background changed to \a visible. | ||||
*/ | ||||
/*! | ||||
\fn void QLegend::colorChanged(QColor) | ||||
The color of the legend background changed to \a color. | ||||
*/ | ||||
/*! | ||||
\fn void QLegend::borderColorChanged(QColor) | ||||
The border color of the legend background changed to \a color. | ||||
Tero Ahola
|
r1357 | */ | ||
sauimone
|
r724 | |||
sauimone
|
r1522 | /*! | ||
\fn void QLegend::fontChanged(QFont) | ||||
The font of markers of the legend changed to \a font. | ||||
*/ | ||||
Tero Ahola
|
r1529 | /*! | ||
\fn void QLegend::labelColorChanged(QColor color) | ||||
This signal is emitted when the color of brush used to draw labels has changed to \a color. | ||||
*/ | ||||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Constructs the legend object and sets the parent to \a parent | ||
*/ | ||||
Michal Klocek
|
r855 | |||
Jani Honkonen
|
r2097 | QLegend::QLegend(QChart *chart): QGraphicsWidget(chart), | ||
d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter, chart, this)) | ||||
sauimone
|
r762 | { | ||
sauimone
|
r626 | setZValue(ChartPresenter::LegendZValue); | ||
Michal Klocek
|
r855 | setFlags(QGraphicsItem::ItemClipsChildrenToShape); | ||
Jani Honkonen
|
r2097 | QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*,Domain*)), d_ptr.data(), SLOT(handleSeriesAdded(QAbstractSeries*,Domain*))); | ||
QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)),d_ptr.data(), SLOT(handleSeriesRemoved(QAbstractSeries*))); | ||||
sauimone
|
r2081 | // QObject::connect(chart->d_ptr->m_dataset,SIGNAL(seriesUpdated(QAbstractSeries*)),d_ptr.data(),SLOT(handleSeriesUpdated(QAbstractSeries*))); | ||
Michal Klocek
|
r1534 | setLayout(d_ptr->m_layout); | ||
Michal Klocek
|
r950 | } | ||
Tero Ahola
|
r1002 | /*! | ||
Destroys the legend object. Legend is always owned by a QChart, so an application should never call this. | ||||
*/ | ||||
Michal Klocek
|
r950 | QLegend::~QLegend() | ||
{ | ||||
sauimone
|
r524 | } | ||
sauimone
|
r724 | /*! | ||
sauimone
|
r1501 | \internal | ||
Michal Klocek
|
r950 | */ | ||
sauimone
|
r524 | void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | ||
{ | ||||
Michal Klocek
|
r950 | Q_UNUSED(option) | ||
Q_UNUSED(widget) | ||||
Michal Klocek
|
r1963 | |||
Jani Honkonen
|
r2097 | if (!d_ptr->m_backgroundVisible) | ||
return; | ||||
Tero Ahola
|
r611 | |||
sauimone
|
r724 | painter->setOpacity(opacity()); | ||
Michal Klocek
|
r950 | painter->setPen(d_ptr->m_pen); | ||
painter->setBrush(d_ptr->m_brush); | ||||
Jani Honkonen
|
r2097 | painter->drawRoundRect(rect(), d_ptr->roundness(rect().width()), d_ptr->roundness(rect().height())); | ||
sauimone
|
r524 | } | ||
Michal Klocek
|
r1534 | |||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Sets the \a brush of legend. Brush affects the background of legend. | ||
*/ | ||||
Tero Ahola
|
r737 | void QLegend::setBrush(const QBrush &brush) | ||
sauimone
|
r540 | { | ||
Michal Klocek
|
r950 | if (d_ptr->m_brush != brush) { | ||
d_ptr->m_brush = brush; | ||||
Michal Klocek
|
r645 | update(); | ||
Tero Ahola
|
r1543 | emit colorChanged(brush.color()); | ||
Michal Klocek
|
r645 | } | ||
} | ||||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Returns the brush used by legend. | ||
*/ | ||||
Michal Klocek
|
r645 | QBrush QLegend::brush() const | ||
{ | ||||
Michal Klocek
|
r950 | return d_ptr->m_brush; | ||
Michal Klocek
|
r645 | } | ||
Tero Ahola
|
r1452 | void QLegend::setColor(QColor color) | ||
{ | ||||
QBrush b = d_ptr->m_brush; | ||||
Tero Ahola
|
r1472 | if (b.style() != Qt::SolidPattern || b.color() != color) { | ||
b.setStyle(Qt::SolidPattern); | ||||
Tero Ahola
|
r1452 | b.setColor(color); | ||
setBrush(b); | ||||
} | ||||
} | ||||
QColor QLegend::color() | ||||
{ | ||||
return d_ptr->m_brush.color(); | ||||
} | ||||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Sets the \a pen of legend. Pen affects the legend borders. | ||
*/ | ||||
Tero Ahola
|
r737 | void QLegend::setPen(const QPen &pen) | ||
Michal Klocek
|
r645 | { | ||
Michal Klocek
|
r950 | if (d_ptr->m_pen != pen) { | ||
d_ptr->m_pen = pen; | ||||
Michal Klocek
|
r645 | update(); | ||
Tero Ahola
|
r1543 | emit borderColorChanged(pen.color()); | ||
Michal Klocek
|
r645 | } | ||
sauimone
|
r540 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Returns the pen used by legend | ||
*/ | ||||
sauimone
|
r724 | |||
Michal Klocek
|
r645 | QPen QLegend::pen() const | ||
sauimone
|
r540 | { | ||
Michal Klocek
|
r950 | return d_ptr->m_pen; | ||
sauimone
|
r540 | } | ||
Michal Klocek
|
r1534 | void QLegend::setFont(const QFont &font) | ||
{ | ||||
if (d_ptr->m_font != font) { | ||||
d_ptr->m_font = font; | ||||
Jani Honkonen
|
r2097 | foreach (LegendMarker *marker, d_ptr->markers()) | ||
Michal Klocek
|
r1534 | marker->setFont(d_ptr->m_font); | ||
Michal Klocek
|
r1536 | layout()->invalidate(); | ||
Michal Klocek
|
r1534 | emit fontChanged(font); | ||
} | ||||
} | ||||
QFont QLegend::font() const | ||||
{ | ||||
Jani Honkonen
|
r2097 | return d_ptr->m_font; | ||
Michal Klocek
|
r1534 | } | ||
Tero Ahola
|
r1452 | void QLegend::setBorderColor(QColor color) | ||
{ | ||||
QPen p = d_ptr->m_pen; | ||||
if (p.color() != color) { | ||||
p.setColor(color); | ||||
setPen(p); | ||||
} | ||||
} | ||||
Tero Ahola
|
r1357 | |||
Tero Ahola
|
r1452 | QColor QLegend::borderColor() | ||
{ | ||||
return d_ptr->m_pen.color(); | ||||
} | ||||
Tero Ahola
|
r1357 | |||
Tero Ahola
|
r1529 | /*! | ||
Set brush used to draw labels to \a brush. | ||||
*/ | ||||
sauimone
|
r1527 | void QLegend::setLabelBrush(const QBrush &brush) | ||
{ | ||||
if (d_ptr->m_labelBrush != brush) { | ||||
Michal Klocek
|
r1534 | d_ptr->m_labelBrush = brush; | ||
foreach (LegendMarker *marker, d_ptr->markers()) { | ||||
marker->setLabelBrush(d_ptr->m_labelBrush); | ||||
Tero Ahola
|
r1795 | // Note: The pen of the marker rectangle could be exposed in the public QLegend API | ||
// instead of mapping it from label brush color | ||||
marker->setPen(brush.color()); | ||||
Michal Klocek
|
r1534 | } | ||
Tero Ahola
|
r1543 | emit labelColorChanged(brush.color()); | ||
sauimone
|
r1527 | } | ||
} | ||||
Tero Ahola
|
r1529 | /*! | ||
Brush used to draw labels. | ||||
*/ | ||||
sauimone
|
r1527 | QBrush QLegend::labelBrush() const | ||
{ | ||||
return d_ptr->m_labelBrush; | ||||
} | ||||
void QLegend::setLabelColor(QColor color) | ||||
{ | ||||
QBrush b = d_ptr->m_labelBrush; | ||||
if (b.style() != Qt::SolidPattern || b.color() != color) { | ||||
b.setStyle(Qt::SolidPattern); | ||||
b.setColor(color); | ||||
setLabelBrush(b); | ||||
} | ||||
} | ||||
QColor QLegend::labelColor() const | ||||
{ | ||||
return d_ptr->m_labelBrush.color(); | ||||
} | ||||
Michal Klocek
|
r1534 | |||
Tero Ahola
|
r1357 | void QLegend::setAlignment(Qt::Alignment alignment) | ||
sauimone
|
r616 | { | ||
Jani Honkonen
|
r2097 | if (d_ptr->m_alignment != alignment) { | ||
Michal Klocek
|
r950 | d_ptr->m_alignment = alignment; | ||
Michal Klocek
|
r2088 | layout()->invalidate(); | ||
Michal Klocek
|
r855 | } | ||
sauimone
|
r716 | } | ||
Tero Ahola
|
r1357 | Qt::Alignment QLegend::alignment() const | ||
sauimone
|
r716 | { | ||
Michal Klocek
|
r950 | return d_ptr->m_alignment; | ||
sauimone
|
r616 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Detaches the legend from chart. Chart won't change layout of the legend. | ||
*/ | ||||
void QLegend::detachFromChart() | ||||
sauimone
|
r524 | { | ||
Michal Klocek
|
r950 | d_ptr->m_attachedToChart = false; | ||
Michal Klocek
|
r2088 | layout()->invalidate(); | ||
Michal Klocek
|
r1534 | setParent(0); | ||
sauimone
|
r586 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Attaches the legend to chart. Chart may change layout of the legend. | ||
*/ | ||||
void QLegend::attachToChart() | ||||
sauimone
|
r586 | { | ||
Michal Klocek
|
r1534 | d_ptr->m_attachedToChart = true; | ||
Michal Klocek
|
r2088 | layout()->invalidate(); | ||
Michal Klocek
|
r1534 | setParent(d_ptr->m_chart); | ||
sauimone
|
r586 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | Returns true, if legend is attached to chart. | ||
*/ | ||||
bool QLegend::isAttachedToChart() | ||||
sauimone
|
r637 | { | ||
Michal Klocek
|
r950 | return d_ptr->m_attachedToChart; | ||
sauimone
|
r637 | } | ||
sauimone
|
r799 | /*! | ||
Michal Klocek
|
r950 | Sets the visibility of legend background to \a visible | ||
*/ | ||||
void QLegend::setBackgroundVisible(bool visible) | ||||
sauimone
|
r799 | { | ||
Jani Honkonen
|
r2097 | if (d_ptr->m_backgroundVisible != visible) { | ||
Tero Ahola
|
r1452 | d_ptr->m_backgroundVisible = visible; | ||
Michal Klocek
|
r950 | update(); | ||
Tero Ahola
|
r1452 | emit backgroundVisibleChanged(visible); | ||
Michal Klocek
|
r950 | } | ||
sauimone
|
r799 | } | ||
/*! | ||||
Michal Klocek
|
r950 | Returns the visibility of legend background | ||
*/ | ||||
bool QLegend::isBackgroundVisible() const | ||||
sauimone
|
r799 | { | ||
Michal Klocek
|
r950 | return d_ptr->m_backgroundVisible; | ||
sauimone
|
r799 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | \internal \a event see QGraphicsWidget for details | ||
*/ | ||||
void QLegend::hideEvent(QHideEvent *event) | ||||
sauimone
|
r529 | { | ||
Jani Honkonen
|
r2097 | if (isAttachedToChart()) | ||
d_ptr->m_presenter->layout()->invalidate(); | ||||
QGraphicsWidget::hideEvent(event); | ||||
sauimone
|
r565 | } | ||
sauimone
|
r724 | /*! | ||
Michal Klocek
|
r950 | \internal \a event see QGraphicsWidget for details | ||
*/ | ||||
void QLegend::showEvent(QShowEvent *event) | ||||
sauimone
|
r565 | { | ||
Jani Honkonen
|
r2097 | if (isAttachedToChart()) { | ||
d_ptr->items()->setVisible(false); | ||||
layout()->invalidate(); | ||||
} | ||||
QGraphicsWidget::showEvent(event); | ||||
//layout activation will show the items | ||||
Michal Klocek
|
r950 | } | ||
Michal Klocek
|
r855 | |||
Michal Klocek
|
r950 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
Jani Honkonen
|
r2104 | QLegendPrivate::QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q) | ||
Jani Honkonen
|
r2097 | : q_ptr(q), | ||
m_presenter(presenter), | ||||
m_layout(new LegendLayout(q)), | ||||
m_chart(chart), | ||||
m_items(new QGraphicsItemGroup(q)), | ||||
m_alignment(Qt::AlignTop), | ||||
m_brush(QBrush()), | ||||
m_pen(QPen()), | ||||
m_labelBrush(QBrush()), | ||||
m_diameter(5), | ||||
m_attachedToChart(true), | ||||
m_backgroundVisible(false) | ||||
Michal Klocek
|
r950 | { | ||
Michal Klocek
|
r855 | |||
sauimone
|
r586 | } | ||
Michal Klocek
|
r950 | QLegendPrivate::~QLegendPrivate() | ||
{ | ||||
sauimone
|
r529 | |||
Michal Klocek
|
r950 | } | ||
void QLegendPrivate::setOffset(qreal x, qreal y) | ||||
Michal Klocek
|
r855 | { | ||
Jani Honkonen
|
r2097 | m_layout->setOffset(x, y); | ||
Michal Klocek
|
r855 | } | ||
sauimone
|
r716 | |||
sauimone
|
r1458 | QPointF QLegendPrivate::offset() const | ||
{ | ||||
Michal Klocek
|
r1534 | return m_layout->offset(); | ||
sauimone
|
r1300 | } | ||
sauimone
|
r1453 | int QLegendPrivate::roundness(qreal size) | ||
{ | ||||
Jani Honkonen
|
r2097 | return 100 * m_diameter / int(size); | ||
sauimone
|
r1453 | } | ||
Tero Ahola
|
r988 | void QLegendPrivate::handleSeriesAdded(QAbstractSeries *series, Domain *domain) | ||
Michal Klocek
|
r855 | { | ||
Michal Klocek
|
r950 | Q_UNUSED(domain) | ||
sauimone
|
r716 | |||
Jani Honkonen
|
r2104 | QList<LegendMarker *> markers = series->d_ptr->createLegendMarker(q_ptr); | ||
Michal Klocek
|
r1534 | |||
Jani Honkonen
|
r2097 | foreach (LegendMarker *marker, markers) { | ||
sauimone
|
r1522 | marker->setFont(m_font); | ||
sauimone
|
r1527 | marker->setLabelBrush(m_labelBrush); | ||
sauimone
|
r1645 | marker->setVisible(series->isVisible()); | ||
Michal Klocek
|
r1534 | m_items->addToGroup(marker); | ||
Jani Honkonen
|
r2097 | m_markers << marker; | ||
sauimone
|
r1522 | } | ||
sauimone
|
r716 | |||
sauimone
|
r1459 | QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged())); | ||
Michal Klocek
|
r2085 | QObject::connect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged())); | ||
Michal Klocek
|
r956 | |||
Michal Klocek
|
r2085 | m_items->setVisible(false); | ||
Michal Klocek
|
r2088 | m_layout->invalidate(); | ||
sauimone
|
r716 | } | ||
Tero Ahola
|
r988 | void QLegendPrivate::handleSeriesRemoved(QAbstractSeries *series) | ||
sauimone
|
r716 | { | ||
Michal Klocek
|
r1534 | foreach (LegendMarker *marker, m_markers) { | ||
Michal Klocek
|
r956 | if (marker->series() == series) { | ||
delete marker; | ||||
Michal Klocek
|
r1534 | m_markers.removeAll(marker); | ||
Michal Klocek
|
r956 | } | ||
} | ||||
sauimone
|
r2081 | QObject::disconnect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged())); | ||
Michal Klocek
|
r2085 | QObject::disconnect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged())); | ||
Michal Klocek
|
r2088 | m_layout->invalidate(); | ||
Michal Klocek
|
r855 | } | ||
sauimone
|
r724 | |||
sauimone
|
r1459 | void QLegendPrivate::handleSeriesVisibleChanged() | ||
{ | ||||
Jani Honkonen
|
r2104 | QAbstractSeries *series = qobject_cast<QAbstractSeries *> (sender()); | ||
Michal Klocek
|
r2085 | Q_ASSERT(series); | ||
sauimone
|
r1459 | |||
Jani Honkonen
|
r2097 | foreach (LegendMarker *marker, m_markers) { | ||
if (marker->series() == series) | ||||
sauimone
|
r1645 | marker->setVisible(series->isVisible()); | ||
sauimone
|
r1459 | } | ||
Michal Klocek
|
r2088 | m_layout->invalidate(); | ||
sauimone
|
r1459 | } | ||
Michal Klocek
|
r2085 | void QLegendPrivate::handleCountChanged() | ||
sauimone
|
r2081 | { | ||
Jani Honkonen
|
r2104 | QAbstractSeriesPrivate *series = qobject_cast<QAbstractSeriesPrivate *> (sender()); | ||
Michal Klocek
|
r2085 | Q_ASSERT(series); | ||
handleSeriesRemoved(series->q_ptr); | ||||
handleSeriesAdded(series->q_ptr, 0); | ||||
sauimone
|
r2081 | } | ||
sauimone
|
r524 | #include "moc_qlegend.cpp" | ||
Michal Klocek
|
r950 | #include "moc_qlegend_p.cpp" | ||
Tero Ahola
|
r737 | |||
sauimone
|
r524 | QTCOMMERCIALCHART_END_NAMESPACE | ||