PDA

View Full Version : QPixmap::setMask() / QWidget::setMask()



yogeshm02
25th February 2006, 11:23
Two methods that i have tried for displaying clipped image:-

1.================
pixmap->setMask(bitmap1);
painter->drawPixmap(pixmap);

2.================
widget->setMask(bitmap1);
painter->drawPixmap(pixmap);

Both methods works correctly (at least in my case) i.e. displays clipped image.

But i'm still confused which method should i use; or should i combine both methods like this: -
pixmap->setMask(bitmap1);
widget->setMask(bitmap1);
painter->drawPixmap(pixmap);

So, please help. :)

EDIT: I'm using qt 4.1.1

yogeshm02
25th February 2006, 11:34
On second thought it seems that correct way is to use method #2; and if need be, use pixmap->setMask(bitmap1) along with that. :cool: