PDA

View Full Version : Gradient fill problem



benzolo
6th September 2010, 09:29
Hi all.

I am trying to fill an area with a gradient around a rect. I only need one color and a transparent gradient. In the attached picture you can see that there is a black rect on the left figure. What I would like to do is to paint a gradient like it is shown inside the red outlined area all around the black rect within the given boundarys. In Opengl it is easy to achieve this by splitting the outer area into triangles and assigning the color values to each vertex (right figure of the attached picture). I could not find anything like this in QT. Are there any other ways to achieve this? With a linear gradient brush I could paint the borders around the rect on the top,bottom,left and rigth, but what about the remaining triangles in the corners?

Any help is appreciated

Regards

Andreas