diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-02-07 09:41:26 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-02-07 08:49:23 +0000 |
commit | d920dfad07c671d45af116b0b1816873074f94b5 (patch) | |
tree | 663821f4ac444d98166153871c608a88e01d5156 | |
parent | ac91bf7984291f46619415213ce089a33fc3e597 (diff) |
Ensure that the box plot series' visibility and opacity is passed on
Change-Id: Ib54be705d53ef0fbf8574c50648eacc4e3c274ed
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/charts/boxplotchart/boxplotchartitem.cpp | 12 | ||||
-rw-r--r-- | src/charts/boxplotchart/boxplotchartitem_p.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/charts/boxplotchart/boxplotchartitem.cpp b/src/charts/boxplotchart/boxplotchartitem.cpp index 2fd2297b..58ff5d47 100644 --- a/src/charts/boxplotchart/boxplotchartitem.cpp +++ b/src/charts/boxplotchart/boxplotchartitem.cpp @@ -44,6 +44,8 @@ BoxPlotChartItem::BoxPlotChartItem(QBoxPlotSeries *series, QGraphicsItem *item) m_animation(0) { connect(series, SIGNAL(boxsetsRemoved(QList<QBoxSet *>)), this, SLOT(handleBoxsetRemove(QList<QBoxSet *>))); + connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged())); + connect(series, SIGNAL(opacityChanged()), this, SLOT(handleOpacityChanged())); connect(series->d_func(), SIGNAL(restructuredBoxes()), this, SLOT(handleDataStructureChanged())); connect(series->d_func(), SIGNAL(updatedLayout()), this, SLOT(handleLayoutChanged())); connect(series->d_func(), SIGNAL(updatedBoxes()), this, SLOT(handleUpdatedBars())); @@ -73,6 +75,16 @@ void BoxPlotChartItem::setAnimation(BoxPlotAnimation *animation) } } +void BoxPlotChartItem::handleSeriesVisibleChanged() +{ + setVisible(m_series->isVisible()); +} + +void BoxPlotChartItem::handleOpacityChanged() +{ + setOpacity(m_series->opacity()); +} + void BoxPlotChartItem::handleDataStructureChanged() { int setCount = m_series->count(); diff --git a/src/charts/boxplotchart/boxplotchartitem_p.h b/src/charts/boxplotchart/boxplotchartitem_p.h index 0d9a4d29..4dbe6aa1 100644 --- a/src/charts/boxplotchart/boxplotchartitem_p.h +++ b/src/charts/boxplotchart/boxplotchartitem_p.h @@ -64,6 +64,8 @@ public: QRectF boundingRect() const; public Q_SLOTS: + void handleSeriesVisibleChanged(); + void handleOpacityChanged(); void handleDataStructureChanged(); void handleDomainUpdated(); void handleLayoutChanged(); |