Fix continuous updateLabels in bars

This does not fix the continous synchData completely, but removes
the unnecessary label updates.

Another patch is needed to take care of the endless sync loop.

Task-number: QTBUG-136174
Change-Id: I222deb86c25a4fafde73c550b0ae7151047a66e2
Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io>
Reviewed-by: Sakaria Pouke <sakaria.pouke@qt.io>
(cherry picked from commit f9fe3c37ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4c96f4b0c4)
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This commit is contained in:
Tomi Korpipaa 2025-07-10 12:23:07 +03:00
parent ebbcc7a86e
commit 857b4e519b
3 changed files with 11 additions and 11 deletions

View File

@ -775,9 +775,9 @@ void QQuickGraphsBars::synchData()
m_changeTracker.barSeriesMarginChanged = false;
}
if (m_axisRangeChanged) {
theme()->resetDirtyBits();
m_axisRangeChanged = false;
if (m_changeTracker.axisRangeChanged) {
adjustAxisRanges();
m_changeTracker.axisRangeChanged = false;
}
QQuickGraphsItem::synchData();
@ -836,7 +836,7 @@ void QQuickGraphsBars::updateParameters()
if (m_cachedBarThickness.isValid())
calculateSceneScalingFactors();
}
m_axisRangeChanged = true;
m_changeTracker.axisRangeChanged = true;
setDataDirty(true);
}
@ -2690,7 +2690,7 @@ void QQuickGraphsBars::updateBarSpecs(float thicknessRatio, QSizeF spacing, bool
m_cachedBarSpacing = m_cachedBarThickness * 2 + spacing * 2;
}
m_axisRangeChanged = true;
m_changeTracker.axisRangeChanged = true;
m_changeTracker.selectedBarChanged = true;
// Calculate here and at setting sample space

View File

@ -34,6 +34,7 @@ struct Bars3DChangeBitField
bool itemChanged : 1;
bool floorLevelChanged : 1;
bool barSeriesMarginChanged : 1;
bool axisRangeChanged : 1;
Bars3DChangeBitField()
: multiSeriesScalingChanged(true)
@ -43,6 +44,7 @@ struct Bars3DChangeBitField
, itemChanged(false)
, floorLevelChanged(false)
, barSeriesMarginChanged(false)
, axisRangeChanged(false)
{}
};
@ -252,8 +254,6 @@ private:
float m_heightNormalizer = 1.0f;
float m_backgroundAdjustment = 0.0f;
bool m_axisRangeChanged = false;
QQuick3DModel *m_floorBackground = nullptr;
QQuick3DNode *m_floorBackgroundScale = nullptr;
QQuick3DNode *m_floorBackgroundRotation = nullptr;

View File

@ -2664,7 +2664,7 @@ void QQuickGraphsItem::synchData()
updateGridLineType();
else
updateGrid();
updateLabels();
m_labelsNeedupdate = true;
updateCustomData();
if (m_sliceView && isSliceEnabled()) {
updateSliceGrid();
@ -2678,7 +2678,7 @@ void QQuickGraphsItem::synchData()
m_changeTracker.radialLabelOffsetChanged = false;
}
if (m_changeTracker.labelMarginChanged) {
updateLabels();
m_labelsNeedupdate = true;
m_changeTracker.labelMarginChanged = false;
}
@ -2918,7 +2918,7 @@ void QQuickGraphsItem::synchData()
m_titleLabelY->setProperty("labelFont", font);
m_titleLabelZ->setProperty("labelFont", font);
m_itemLabel->setProperty("labelFont", font);
updateLabels();
m_labelsNeedupdate = true;
if (m_sliceView && isSliceEnabled()) {
changeLabelFont(m_sliceHorizontalLabelRepeater, font);
@ -3023,7 +3023,7 @@ void QQuickGraphsItem::synchData()
updateGridLineType();
else
updateGrid();
updateLabels();
m_labelsNeedupdate = true;
if (m_sliceView && isSliceEnabled()) {
updateSliceGrid();
updateSliceLabels();