Allow requesting depth testing via beginPaint


QCPainter does not test or write the depth buffer. Now one can request
depth test by passing the DepthTest flag to beginPaint(). This allows
testing against content already rendered into the depth buffer.

The main use case is integrating QCPainter rendering into Qt Quick via
QSGRenderNode (depth testing against the depth values written by opaque
items in the scene is a must then), or integrating QCPainter rendering
with any other engine without going through a texture.

It is regardless good to add a flags argument to beginPaint(), to make
the API more robust when it comes to future extensibility. endPaint()
already has its own flags.

Pick-to: 6.11
Change-Id: Ica927a30a3c12811935a988f5e72f09f7bac98fe
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
commitc0301ea990998d95c24bfe696a5a29ed673e14d4
parentb45863dfa323e8ddaa85de099ac92c198d2e6f82
authorLaszlo Agocs <laszlo.agocs@qt.io>
committerLaszlo Agocs <laszlo.agocs@qt.io>
commit timeFri, 23 Jan 2026 12:18:18 +0100