Folks,
I am trying to draw a multi segment line with different color of each part, is there any ways to do this with QPainterPath ?
Coz there will be hundreds of segments, so that would be great if not using hundreds of path.
-Ed
Folks,
I am trying to draw a multi segment line with different color of each part, is there any ways to do this with QPainterPath ?
Coz there will be hundreds of segments, so that would be great if not using hundreds of path.
-Ed
QPainterPath only stores shapes, not their properties such as colours.
QGradientand its subclasses might be of interest to you
thanks, i know QPainterPath doesnt maintain any information regarding color.
however, I want drawing a multi-color line into QGraphicsScene for better rotate/zoom in-out handling.
is there any similar approaches ?
QPainterPath itself has nothing to do with "drawing". If you want to draw something, take a look at QPainter class. There is a QPainter::drawLine() method that is meant to draw lines. You can loop over your set of lines, change pen colours and draw lines.
Bookmarks