summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-10-05 10:21:18 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-05 11:18:16 (GMT)
commit22f88f83b86cd0c8d9fc5b1daef62ec68807a81a (patch)
tree0e6842a6132a154c2124482a8464b74c428b3a1c
parent9815de3fbdbca8bda881e939274b3133492933fb (diff)
downloadQt-22f88f83b86cd0c8d9fc5b1daef62ec68807a81a.zip
Qt-22f88f83b86cd0c8d9fc5b1daef62ec68807a81a.tar.gz
Qt-22f88f83b86cd0c8d9fc5b1daef62ec68807a81a.tar.bz2
Made X11 QPixmap backend return proper pixmap in alphaChannel().
Reviewed-by: Gunnar (cherry picked from commit c1d24c6b87dcc4c6e2f6f258c0198fdb6b2795f0)
-rw-r--r--src/gui/image/qpixmap_x11.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 6cde898..92a7e7d 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1252,8 +1252,11 @@ void QX11PixmapData::release()
QPixmap QX11PixmapData::alphaChannel() const
{
- if (!hasAlphaChannel())
- return QPixmap();
+ if (!hasAlphaChannel()) {
+ QPixmap pm(w, h);
+ pm.fill(Qt::white);
+ return pm;
+ }
QImage im(toImage());
return QPixmap::fromImage(im.alphaChannel(), Qt::OrderedDither);
}