[Solved] Gradient with QPen?
-
I would like to have a color interpolation for the rim of a graphical object. However, QPen doesn't seem to support gradients.
How can I achieve such an effect?
Edit: My main interest lies in GraphicsView, but solutions for other painting systems might be interesting, too.
-
QBrush supports gradients. And QBrush is used for areas. So you need to create a shape (e.g. QPainterPath) and set the gradient brush on it.
-
Sounds like that might actually work. Once again, I regret that I can't "rate up" replies to my threads.
Thanks! -
you may want to file a feature request "here":https://bugreports.qt-project.org/browse/QTWEBSITE. ;)
-
The implementation is already there, but it is not used yet. See "here":/qna_forum for instance.