Qt 6.11 is out! See what's new in the release
blog
[SOLVED] Multi colored PolyLines?
General and Desktop
4
Posts
3
Posters
4.9k
Views
1
Watching
-
Is there a way to draw PolyLines with a QPainter, so that each element of the polyline may have a different color or do I have to realize this with seperate lines?
-
You can use a QLinearGradient and pass it to QPainter using QBrush and setBrush()!
-
[quote author="mlong" date="1311786901"]If loladiro's suggestion doesn't do what you need, then you'll need to draw each line segment on your own by iterating over the line segments and adjusting the pen accordingly for each one.
[/quote]Already did it this way (also for another couple or reasons!)
Thanks