summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_x11.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-10-05 13:14:11 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-10-05 13:21:08 +0200
commitb8b13494ed151595c5fc104572655f667870e6e1 (patch)
tree843bbb44edc402d08236d3711d75789ee5c7cdbf /src/gui/image/qpixmap_x11.cpp
parent3474f3db5737218ca403885e94826a07ddc915b2 (diff)
Made X11 pixmap backend's fromImage() check for Qt::NoOpaqueDetection.
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/image/qpixmap_x11.cpp')
-rw-r--r--src/gui/image/qpixmap_x11.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 92a7e7d67c..74543a034a 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -387,7 +387,14 @@ struct QX11AlphaDetector
return hasAlpha();
}
- QX11AlphaDetector(const QImage *i) : image(i), checked(false), has(false) { }
+ QX11AlphaDetector(const QImage *i, Qt::ImageConversionFlags flags)
+ : image(i), checked(false), has(false)
+ {
+ if (flags & Qt::NoOpaqueDetection) {
+ checked = true;
+ has = image->hasAlphaChannel();
+ }
+ }
const QImage *image;
mutable bool checked;
@@ -427,7 +434,7 @@ void QX11PixmapData::fromImage(const QImage &img,
return;
}
- QX11AlphaDetector alphaCheck(&img);
+ QX11AlphaDetector alphaCheck(&img, flags);
int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
if (qt_x11_preferred_pixmap_depth)