Remove public QCanvasBrush inheritance


Each brush family type (gradients, image/grid patterns, box shadow,
custom brush) is now a standalone value type that converts to
QCanvasBrush via operator QCanvasBrush() and is recovered from it via
QCanvasBrush::as<T>(). The private class hierarchy is unchanged.

QCanvasGradient is converted to a plain-old-data structure,
similar to QGradient, but with an API that supports the
QCanvasPainter feature set. All the data is in the base
QCanvasGradient class, so slicing will not cause data loss.
QCanvasGradientPrivate is renamed to QCanvasGradientBrushPrivate,
since it is no longer the private class for QCanvasGradient. The
same is done for the subclasses.

This fixes the type-safety bug where e.g. linearGrad.swap(imagebrush)
would silently compile, breaking the type invariants and causing
incompatible static_casts.

AI disclosure: The mechanical refactoring and the autotest code
is mainly done by Claude Sonnet 4.6. This is based on established
patterns in the Qt source code, not introducing new concepts or
algorithms.

Change-Id: Ic5c4a5ec04a661a396465f8534b9d2effb86a99b
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
commit45af4576b7fa97fb6c383000c51825128c668337
parent389387d37ed541ef4a8485280d17349533f20a0d
authorPaul Olav Tvete <paul.tvete@qt.io>
committerPaul Olav Tvete <paul.tvete@qt.io>
commit timeWed, 13 May 2026 13:44:54 +0000