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.

Pick-to: 6.9 6.10
Task-number: QTBUG-136174
Change-Id: I222deb86c25a4fafde73c550b0ae7151047a66e2
Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io>
Reviewed-by: Sakaria Pouke <sakaria.pouke@qt.io>
This commit is contained in:
Tomi Korpipaa 2025-07-10 12:23:07 +03:00
parent d3a4391619
commit f9fe3c37ee
4 changed files with 12 additions and 13 deletions

View File

@ -128,7 +128,7 @@ QCategory3DAxisPrivate::~QCategory3DAxisPrivate() {}
void QCategory3DAxisPrivate::setDataLabels(const QStringList &labels)
{
Q_Q(QCategory3DAxis);
if (m_labelsExplicitlySet && m_labels == labels) {
if (m_labelsExplicitlySet || m_labels == labels) {
qCDebug(lcAProperties3D) << __FUNCTION__
<< "value is already set to:" << labels;
return;
@ -136,7 +136,6 @@ void QCategory3DAxisPrivate::setDataLabels(const QStringList &labels)
m_labels = labels;
emit q->QAbstract3DAxis::labelsChanged();
}
bool QCategory3DAxisPrivate::allowZero()

View File

@ -1000,9 +1000,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();
@ -1063,7 +1063,7 @@ void QQuickGraphsBars::updateParameters()
if (m_cachedBarThickness.isValid())
calculateSceneScalingFactors();
}
m_axisRangeChanged = true;
m_changeTracker.axisRangeChanged = true;
setDataDirty(true);
}
@ -2965,7 +2965,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)
{}
};
@ -269,8 +271,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

@ -2714,7 +2714,7 @@ void QQuickGraphsItem::synchData()
updateGridLineType();
else
updateGrid();
updateLabels();
m_labelsNeedupdate = true;
updateCustomData();
if (m_sliceView && isSliceEnabled()) {
updateSliceGrid();
@ -2728,7 +2728,7 @@ void QQuickGraphsItem::synchData()
m_changeTracker.radialLabelOffsetChanged = false;
}
if (m_changeTracker.labelMarginChanged) {
updateLabels();
m_labelsNeedupdate = true;
m_changeTracker.labelMarginChanged = false;
}
@ -2968,7 +2968,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);
@ -3073,7 +3073,7 @@ void QQuickGraphsItem::synchData()
updateGridLineType();
else
updateGrid();
updateLabels();
m_labelsNeedupdate = true;
if (m_sliceView && isSliceEnabled()) {
updateSliceGrid();
updateSliceLabels();