summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-04-20 15:10:44 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-04-21 16:40:38 +0000
commit53e596ce6b188231fec312c8f7f1183ef751da59 (patch)
tree2e51dfc90c990d8bdccd3e8718e373d5b5c481f0
parent96a59f576c0451d4b0c916098bcfd070f8293252 (diff)
Do not use global pointsConfigurationDirty flag
The flag is toggled only when the pointsConfiguration() is changed. Later this flag is used to check if we need to resize the markers for the points. If the points are removed, and later re-added without changing the pointsConfiguration(), this flag was preventing a proper size update of the markers. Fix it by simply removing the global flag, as all the other places where pointsConfiguration() is used do not check it anyway. Task-number: QTBUG-112919 Change-Id: Ic56eb94c94dda319d23f6d6eadfd4df884618064 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Lukasz Kosinski <lukasz@scythe-studio.com> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit 2de0293dfc38090d448f095d2a3bd58134d5b026) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/charts/scatterchart/scatterchartitem.cpp7
-rw-r--r--src/charts/xychart/xychart_p.h1
2 files changed, 4 insertions, 4 deletions
diff --git a/src/charts/scatterchart/scatterchartitem.cpp b/src/charts/scatterchart/scatterchartitem.cpp
index ca6bae51..99c89415 100644
--- a/src/charts/scatterchart/scatterchartitem.cpp
+++ b/src/charts/scatterchart/scatterchartitem.cpp
@@ -233,7 +233,7 @@ void ScatterChartItem::updateGeometry()
static_cast<QAbstractGraphicsShapeItem *>(items.at(i));
const QPointF &point = points.at(i);
- if (m_pointsConfiguration.contains(i) && m_pointsConfigurationDirty) {
+ if (m_pointsConfiguration.contains(i)) {
const auto &conf = m_pointsConfiguration[i];
if (conf.contains(QXYSeries::PointConfiguration::Size))
resizeMarker(
@@ -458,7 +458,8 @@ void ScatterChartItem::handleSeriesUpdated()
if (count == 0)
return;
- m_pointsConfigurationDirty = m_series->pointsConfiguration() != m_pointsConfiguration;
+ const bool pointsConfigurationDirty =
+ m_series->pointsConfiguration() != m_pointsConfiguration;
bool recreate = m_visible != m_series->isVisible()
|| m_pointsVisible != m_series->pointsVisible()
@@ -466,7 +467,7 @@ void ScatterChartItem::handleSeriesUpdated()
|| m_markerShape != m_series->markerShape()
|| m_selectedColor != m_series->selectedColor()
|| m_selectedPoints != m_series->selectedPoints()
- || m_pointsConfigurationDirty;
+ || pointsConfigurationDirty;
m_visible = m_series->isVisible();
m_markerSize = m_series->markerSize();
m_markerShape = m_series->markerShape();
diff --git a/src/charts/xychart/xychart_p.h b/src/charts/xychart/xychart_p.h
index 300b5c89..63958e6d 100644
--- a/src/charts/xychart/xychart_p.h
+++ b/src/charts/xychart/xychart_p.h
@@ -82,7 +82,6 @@ protected:
bool m_dirty;
QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> m_pointsConfiguration;
- bool m_pointsConfigurationDirty;
friend class AreaChartItem;
};