I have a custom QWidget class with an extensive paintEvent function. It draws multiple nested polygons inside that widget using QPainter, setting its brush and pen, and calling its drawPolygon function. I want to add an inner shadow to these polygons to increase depth perception. I have seen here that QML is used. I would need to reorganize my whole code for this, which would not be worth the time. Is there any way without using QML?
For now, I'm using QRadialGradient as the QPainter's brush, which is fine but not quite what I wanted. I construct a circle depending on the x, and y coordinates farthest away from the polygon's centroid. I considered constructing an ellipse that closes the polygon inside as a substitute and using QRadialGradient by setting its angle and horizontal and vertical radius. But it seems not worth it. Also, a not-worth-it-solution would be to add a scaled-down polygon and connect old and new vertices to construct polygons around the scaled polygon along the sides and use a linear gradient for these. But yeah... not worth it, I guess.
I hope I understandably stated my problem, I appreciate any help you can provide.