QWidget masking with antialiasing

Viewed 245

I need to mask a QWidget with a rounded rectangle, but I haven't been able to find a way to do so with antialiasing. The issue is that setMask only accepts a QBitmap or QRegion, and of course no alpha channel means no antialiasing. The content of the QWidget itself needs to be clipped, so just setting the border-radius in the stylesheet isn't an option. I know there's no workarounds for setting a mask with setMask with antialiasing, but is there any other possible method that could achieve this, even if it's a hacky solution or workaround?

What I'm trying to achieve is clipped antialiased widget content (such as other widgets inside) without having to modify the content itself:

Example

0 Answers
Related