PDA

View Full Version : How to create region with rounded corners



sanjayshelke
30th June 2009, 09:37
Hi,

I need to create a widget with rounded corners.
I can do this using setMask.
But how to create a QRegion with rounded corners so that i can use this region in setMask.


Regards,
~Sanjay

wysota
30th June 2009, 10:23
Add a rounded rect to QPainterPath, convert it to a polygon and then to a region.

But it might be much easier if you go through the version of setMask() that takes a bitmap - simply create a pixmap and draw a rounded rect on it.