2D: Fix GraphsView axes misplaced on first frame


AxisRenderer::updateAxisMeasurements() needs a valid QGraphsTheme to
measure axis label sizes, and bails out (leaving axis margins at zero)
when the theme isn't set yet. During QML construction, axisX/axisY
setters can trigger this before QGraphsView::componentComplete() has
assigned a theme.

componentComplete() does assign the default theme and calls
resetColorTheme(), expecting the resulting QGraphsTheme::update signal
to trigger a margin recompute. But resetColorTheme() sets the theme to
QtGreen, which is already the default, so QGraphsTheme::setTheme()'s
"no change" guard swallows the signal and the recompute never happens.
The stale zero margins are what render on the first frame; a
subsequent geometryChange() unconditionally recomputes them correctly,
which is why resizing the window "fixes" it.

Explicitly recompute the component sizes after the default theme is
assigned, mirroring what setTheme() already does for the explicit
theme case. This is scoped to instances that actually have an axis
renderer, so it doesn't affect axis-less GraphsViews that never
computed a plot area before.

Pick-to: 6.12 6.11
Fixes: QTBUG-147723
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Change-Id: I6b5f697656e00439382ab664b1afc1c731f1b7b6
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
commit52e6e9ffbbe329545b0eed1c75a6c9e45f09218d
parent6f81a9a80c4c243a45b23f023c1527270e329831
authorSami Varanka <sami.varanka@qt.io>
committerSami Varanka <sami.varanka@qt.io>
commit timeMon, 31 Aug 2026 12:12:22 +0000