summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-27 01:00:10 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-27 01:00:11 +0200
commit03f7d0a005eca7c796c8721a8bec860e320f4219 (patch)
tree255b5b6a8d09e973fd52ae48b1373f95a6ebfda2 /src/plugins/imageformats
parentc530ca1c170798159c3d84029841a1224d1cdc65 (diff)
parentd6e65ecac5852ed09fbf580b3fab5b21125dfd69 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/plugins/imageformats')
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 30935cacda..4908850cc5 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -523,17 +523,21 @@ QImage ICOReader::iconAt(int index)
if (!image.isNull()) {
readBMP(image);
if (!image.isNull()) {
- QImage mask(image.width(), image.height(), QImage::Format_Mono);
- if (!mask.isNull()) {
- mask.setColorCount(2);
- mask.setColor(0, qRgba(255,255,255,0xff));
- mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
- read1BitBMP(mask);
+ if (icoAttrib.depth == 32) {
+ img = std::move(image).convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ } else {
+ QImage mask(image.width(), image.height(), QImage::Format_Mono);
if (!mask.isNull()) {
- img = image;
- img.setAlphaChannel(mask);
- // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
- // of partially transparent pixels in those icons that have that)
+ mask.setColorCount(2);
+ mask.setColor(0, qRgba(255,255,255,0xff));
+ mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
+ read1BitBMP(mask);
+ if (!mask.isNull()) {
+ img = image;
+ img.setAlphaChannel(mask);
+ // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
+ // of partially transparent pixels in those icons that have that)
+ }
}
}
}