QTiffHandler: simplify use of TIFFWriteScanline() in write()


Fix the impedance mismatch between TIFFWriteScanline() wanting a void*
while QImage::scanLine() only provides pointer-to-const. Only one
caller correctly used a const_cast<uchar*>(), some were using C-style
casts to cast away const.

To fix, add a lambda, writeScanline, which takes the line by const
void*, and const-casts internally.

As a drive-by, remove the unneeded reinterpret_cast<uint32_t*>() (both
the new lambda and the old TIFFWriteScanline() take void*, so don't
need that cast).

Amends many. Because it is kinda invasive, pick to all active
branches, to not block real security fixes later on.

Pick-to: 6.12 6.11 6.8
Change-Id: I907a3f4197314857143f14519ab4620f660271b9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
commitae7c18d1e0bdcfce8abc1347a43c9c74ac5a3d37
parent5417d0685d31fd8f529b9ec300fe1173cafe85d6
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeFri, 17 Jul 2026 10:26:14 +0000