Hi all
I want to make my widgets bottom right and bottom left corner round without using QPaint
regards
merry
Hi all
I want to make my widgets bottom right and bottom left corner round without using QPaint
regards
merry
Always Believe in Urself![]()
Merry
Hi.
Please search this link http://www.qtcentre.org/forum/f-qt-p...ners-3205.html
![]()
Hi Sabeesh
Thanx 4 sending me the link but this link is not opening
regards
merry![]()
Always Believe in Urself![]()
Merry
Search the forum, please. Hint: search for "rounded corners".
J-P Nurmi
Hi,
Please try this.
http://www.qtcentre.org/forum/f-qt-p...ners-3205.html
Or you can use stylesheets.
Thanx for the replies
When I use this
Qt Code:
{ QRegion region; // middle and borders region += rect.adjusted(r, 0, -r, 0); region += rect.adjusted(0, r, 0, -r); // top left // top right corner.moveTopRight(rect.topRight()); // bottom left corner.moveBottomLeft(rect.bottomLeft()); // bottom right corner.moveBottomRight(rect.bottomRight()); return region; } someWidget->setMask(roundedRect(someWidget->rect(), 20));To copy to clipboard, switch view to plain text mode
All the corners of the widget get rounded , and I want only the bottom left and bottom right corners
If in the above code ,I wont make calculations for the top left and top right corners then
some part of the top left and top right corners is subtracted from the widget.
regards
merry
Always Believe in Urself![]()
Merry
You're creating a mask by putting together a combination of quarter circles and rectangles. Just think about how to build that. You'll need one rectangle for the widget minus the bottom edge, so width() and height()-r. Then you'll want the bottom left and right corners as shown above, and the bottom edge between the corners (width()-2*r and height is r)
Bookmarks