PDA

View Full Version : setMask Problems



BatteryCell
1st October 2007, 22:47
I need to cut in half a widget a few times, so I decided to use masks, the only thing is that I can't get them to work with rectangles.
So this does not work:

QRegion maskedRegion(0,0,width(),height()/2);
setMask(maskedRegion);
However, this does (but doesn't get me what I want seeing as its an ellipse):

QRegion maskedRegion(0,0,width(),height()/2,QRegion::Ellipse);
setMask(maskedRegion);

Right now I call these from outside a resize event, however when I tried from within one all I got was a black section where the mask should have been.


Is there some method that I have to call afterwards of something? I've tried update and repaint but no success.

jpn
6th October 2007, 19:53
Could you, by any chance, provide something compilable we can test ourselves?

BatteryCell
7th October 2007, 23:54
I found out it was compiz, I ran the same program with kwin and the masking was fine, apparently compiz has problems with masks.

Thanks anyways :-)