diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-08 15:51:46 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-12 18:57:00 +0000 |
commit | 966e893151952d19131f21738861c483b8af042c (patch) | |
tree | e2d8d23af9ea30df6c536618ccc07fe45e94f255 /src/plugins/platforms/windows/qwindowsmime.cpp | |
parent | 62984d89187b2a65137db3029235d358dd3c703a (diff) |
Windows QPA: Prefer const-versions of API where applicable.
Ensure no detaching occurs by using Container::constFirst()
and QImage::constScanLine().
Change-Id: Ie197d795d9329de8be76ed388ba2c71ccf201f5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsmime.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsmime.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp index eaaf2820ee..a8264b55c0 100644 --- a/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/src/plugins/platforms/windows/qwindowsmime.cpp @@ -175,8 +175,8 @@ static bool qt_write_dibv5(QDataStream &s, QImage image) memset(buf, 0, bpl_bmp); for (int y=image.height()-1; y>=0; y--) { // write the image bits - QRgb *p = (QRgb *)image.scanLine(y); - QRgb *end = p + image.width(); + const QRgb *p = reinterpret_cast<const QRgb *>(image.constScanLine(y)); + const QRgb *end = p + image.width(); b = buf; while (p < end) { int alpha = qAlpha(*p); |