PDA

View Full Version : QPainterPath outlining



viridis
10th March 2008, 13:39
Hi,

I've a little problem with painterpath outlines.
What I want to do is creating a paiterpath with several lines and render it with a large width.
The problem is that I want to use a color to fill the painterpath, and use an other color for the outline.
Painterpath seems to do that but the outline is not really the "global" outline of the whole path, but rather the union of the outline of each subpaths.

For example :

(1) is the painterpath
(2) is what I have when using a pathstroker to get the painterpath with the desired width (rendered using a QPen for the outline and a QBrush for the plain part)
(3) is what I want



# ___ ___
# | | | | |
# | |_|____ | |____
# |______ |_|____| |______|

(1) (2) (3)


Any idea how to correct that ?

wysota
12th March 2008, 21:09
Qt 4.4 has a QPainterPath::simplified() method that probably does what you want.

viridis
14th March 2008, 19:32
Hey, It works ! Thanks a lot !!