qppmhandler: avoid implicit detach

by const method usage

Change-Id: If8e4d0c543837917d29361a116b955890b8a279f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Anton Kudryavtsev 2023-09-15 14:38:20 +03:00
parent ea6c037435
commit b2dd879f0a

View File

@ -341,7 +341,7 @@ static bool write_pbm_image(QIODevice *out, const QImage &sourceImage, const QBy
qsizetype bpl = qsizetype(w) * (gray ? 1 : 3);
uchar *buf = new uchar[bpl];
if (image.format() == QImage::Format_Indexed8) {
QList<QRgb> color = image.colorTable();
const QList<QRgb> color = image.colorTable();
for (uint y=0; y<h; y++) {
const uchar *b = image.constScanLine(y);
uchar *p = buf;