QPixmap pix1(":/PixmapTest/Resources/Chrysanthemum.jpg");
QPixmap temp(pix1.size());
temp.fill(Qt::transparent);
QPainter p1(&temp);
p1.setCompositionMode(QPainter::CompositionMode_Source);
p1.drawPixmap(0, 0, pix1);
p1.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p1.fillRect(temp.rect(), QColor(0, 0, 0, 64));
p1.end();
pix1 = temp;
原文:http://www.cnblogs.com/yanhuiw/p/3928868.html