[SOLVED] Round Button Jaggies
-
I am trying to use a round button on a screen with a background image but I am getting jagged edges from the mask. How can I minimise or eliminate these?
Here is the original button with its clear background, on the screen background.
https://www.dropbox.com/s/tm3o2hv685ctdmg/Button1.jpgWhen I try to mask out the dark rectangular area around the button, here is what I get.
https://www.dropbox.com/sh/g8l6lfdd8mxdct4/_PBEhN9hgG#lh:null-Button2.jpgHere is the code I used.
@ QRect rect1 = new QRect(10,10,110,110);
QRegion region1 = new QRegion(*rect1,QRegion::Ellipse);
ui->pushButton->setMask(*region1);
@The jagged edges around the button are considerable and I'd like to know how to get rid of them.
BTW, how come the button on the first image (which is on a transparent background) still shades over the rectangular area around the button, and just doesn't let the screen background come through correctly. It seems that the background partially comes through but not entirely.
Thanks and regards,
James -
Hi,
Might it not be easier to use the stylesheets on the pushButton. There might be "rounding" parameters for the pushButton corners. Increase that and you will get a oval ;-)