Improve text wrapping and bounding box


Fix textBoundingBox to work correctly also when the given maxWidth
is smaller than the resulting bounding box with all align modes.

The documentation was referring to old behavior, before text wrapping
support. Now with the separate text wrapping flags, it makes sense to
default the maxWidth to 0 instead of -1, as it is no longer a special
value. Add extra lancelot test and API docs snippets for both Canvas
Painter and Canvas2D.

Pick-to: 6.12
Change-Id: Iecf0644b0ef0a7bb2c1eec3b763309090726e313
Reviewed-by: Owais Akhtar <owais.akhtar@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commitf2ac849cde63c319ac6d2580c37052fd1afde52e
parent6bb637aae553d8ed6861b7bc7818dede6a2600f3
authorKaj Grönholm <kaj.gronholm@qt.io>
committerKaj Grönholm <kaj.gronholm@qt.io>
commit timeWed, 10 Jun 2026 14:22:12 +0000