Doc: Expand Canvas.requestAnimationFrame()


The documentation for requesting an animation frame on a Canvas is a
single sentence. It doesn't say why you would use it, that the callback
runs only once, what argument it receives, or that it runs only while
the canvas is visible. It also doesn't say where drawing should happen.
Authors coming from the HTML canvas guess at these rules. They often
draw in the paint handler and wonder why it stays silent while an
animation runs.

Explain that the callback is synchronized with rendering, unlike a
Timer, and point to FrameAnimation for animations that don't draw.
Describe the one-shot behavior and the timestamp argument. State that
callbacks wait until the canvas is visible. Explain that drawing done
in the callback is shown in that same frame without asking for a
repaint. Add a short animated example and a link to the cancel
counterpart. Readers get a working pattern to copy instead of
reverse-engineering the behavior.

Fixes: QTBUG-46554
Pick-to: 6.12
Change-Id: Ieb29becc74bfa776f93492fb99d2bbacd8bf13ca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commit54abd771763cfaa878ec859168477d79395e3c21
parent3b0c27ea44c48511111db4481647ba969c146ee9
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeTue, 20 Oct 2026 17:56:09 +0000