Results 1 to 3 of 3

Thread: QPainterPath outlining

  1. #1
    Join Date
    Feb 2008
    Posts
    26
    Thanks
    5
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QPainterPath outlining

    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

    Qt Code:
    1. # ___ ___
    2. # | | | | |
    3. # | |_|____ | |____
    4. # |______ |_|____| |______|
    5.  
    6. (1) (2) (3)
    To copy to clipboard, switch view to plain text mode 

    Any idea how to correct that ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QPainterPath outlining

    Qt 4.4 has a QPainterPath::simplified() method that probably does what you want.

  3. The following user says thank you to wysota for this useful post:

    viridis (14th March 2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    26
    Thanks
    5
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPainterPath outlining

    Hey, It works ! Thanks a lot !!

Similar Threads

  1. QPainterPath horizontal flip
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 28th October 2007, 20:17
  2. QPainterPath drawing problem
    By shad in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2007, 13:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.