I just found this:
http://doc.trolltech.com/latest/qgra...mode-enum.html
So if you set the transparency right, that should work!
Excerpt of the source code of how this is implemented internally :->
void updateShape()
{
switch (shapeMode) {
if (!mask.isNull()) {
shape
= qt_regionToPath
(QRegion(mask
).
translated(offset.
toPoint()));
break;
}
// FALL THROUGH
}
shape.
addRect(QRectF(offset.
x(), offset.
y(), pixmap.
width(), pixmap.
height()));
break;
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
shape
= qt_regionToPath
(QRegion(pixmap.
createHeuristicMask()).
translated(offset.
toPoint()));
#else
shape.
addRect(QRectF(offset.
x(), offset.
y(), pixmap.
width(), pixmap.
height()));
#endif
break;
}
}
void updateShape()
{
shape = QPainterPath();
switch (shapeMode) {
case QGraphicsPixmapItem::MaskShape: {
QBitmap mask = pixmap.mask();
if (!mask.isNull()) {
shape = qt_regionToPath(QRegion(mask).translated(offset.toPoint()));
break;
}
// FALL THROUGH
}
case QGraphicsPixmapItem::BoundingRectShape:
shape.addRect(QRectF(offset.x(), offset.y(), pixmap.width(), pixmap.height()));
break;
case QGraphicsPixmapItem::HeuristicMaskShape:
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
shape = qt_regionToPath(QRegion(pixmap.createHeuristicMask()).translated(offset.toPoint()));
#else
shape.addRect(QRectF(offset.x(), offset.y(), pixmap.width(), pixmap.height()));
#endif
break;
}
}
To copy to clipboard, switch view to plain text mode
Joh
Bookmarks