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>