diff options
author | Drew Budwin <dbudwin@foxguardsolutions.com> | 2018-02-12 15:39:26 -0500 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-02-15 09:21:42 +0000 |
commit | b78d45e7bcb10a0faf01aff4f8c632957d63e9d7 (patch) | |
tree | 521ad567e26903a099fcdc902bf2728d93088d71 | |
parent | 4aff96b9bb614128043f448eaca3ff7808fd5ad1 (diff) |
Fix empty chart when using QHBoxPlotModelMapper
Making a box plot using QVBoxPlotModelMapper worked fine, but using
QHBoxPlotModelMapper caused the chart to be empty. Add the missing
call to QHBoxPlotModelMapper::setSeries() to
DeclarativeBoxPlotSeries::componentComplete().
[QtCharts][DeclarativeBoxPlotSeries] Fixed a bug fix causing
QHBoxPlotModelMapper to not add series
Task-number: QTBUG-66319
Change-Id: I3654a0709ec2853579a90a8713a702991d084c09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/chartsqml2/declarativeboxplotseries.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/chartsqml2/declarativeboxplotseries.cpp b/src/chartsqml2/declarativeboxplotseries.cpp index 98feea82..219d7a7d 100644 --- a/src/chartsqml2/declarativeboxplotseries.cpp +++ b/src/chartsqml2/declarativeboxplotseries.cpp @@ -30,6 +30,7 @@ #include "declarativebarseries_p.h" #include "declarativeboxplotseries_p.h" #include <QtCharts/QBoxSet> +#include <QtCharts/QHBoxPlotModelMapper> #include <QtCharts/QVBoxPlotModelMapper> QT_CHARTS_BEGIN_NAMESPACE @@ -405,6 +406,8 @@ void DeclarativeBoxPlotSeries::componentComplete() } else if (qobject_cast<QVBoxPlotModelMapper *>(child)) { QVBoxPlotModelMapper *mapper = qobject_cast<QVBoxPlotModelMapper *>(child); mapper->setSeries(this); + } else if (QHBoxPlotModelMapper *mapper = qobject_cast<QHBoxPlotModelMapper *>(child)) { + mapper->setSeries(this); } } } |