PDA

View Full Version : Shapemode



dreamer
2nd May 2008, 09:17
The mode QGraphicsPixmapItem::BoundingRectShape has this kind of behaviour:

"The shape is determined by tracing the outline of the pixmap. This is the fastest shape mode, but it does not take into account any transparent areas on the pixmap."

How can i have a different behaviour? I'd like to take into account also the transparent areas on a pixmap so when i call the function itemAt(), it will return the item even if I put the mouse cursor on the transparent area.

perhaps i have to use the setMask() function.....?? How can i use it?

aamer4yu
2nd May 2008, 16:41
Your requirement -

How can i have a different behaviour? I'd like to take into account also the transparent areas on a pixmap

QGraphicsPixmapItem::BoundingRectShape behaviour:


"The shape is determined by tracing the outline of the pixmap. This is the fastest shape mode, but it does not take into account any transparent areas on the pixmap."


arent they similar ?? does not take into account means it includes the transparent pixels too.


for QGraphicsPixmapItem::MaskShape

The shape is determined by calling QPixmap::mask(). This shape includes only the opaque pixels of the pixmap. Because the shape is more complex, however, it can be slower than the other modes, and uses more memory.
In this the transparent pixels are ignored


Did u try setting the QGraphicsPixmapItem::BoundingRectShape and check how it works ??

dreamer
2nd May 2008, 17:21
i try it and now works........thx a lot..............:D:D:D:D