[Solved] Gradient with QPen?
General and Desktop
5
Posts
3
Posters
3.3k
Views
1
Watching
-
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. ;)