What about using QWidget::setMask() on the button to give it a shape instead of funky effect and setting the shadow using a setGraphicsEffect()?
What about using QWidget::setMask() on the button to give it a shape instead of funky effect and setting the shadow using a setGraphicsEffect()?
Thanks.
The problem with setMask is the edges aren't anti-aliased and I couldn't work out how to do this otherwise it would seem like the best solution.
I'm currently using a QPainterPath for the masking graphics effect, which masks the inner button and anti-aliases the edges.
Can you use a QPainterPath with setmask?
You can use painter path (indirectly) with set mask:
Qt Code:
To copy to clipboard, switch view to plain text mode
But this will result in the same issue - edges will not be antialiased.
As far as I know only way to have aliased edges is to draw them using QPainter.
If you don't want to do that, maybe you could combine both effects into one shadow_and_shape effect?
Bookmarks