Results 1 to 3 of 3

Thread: Qpen, QBrush or QPainterpath problem

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Qpen, QBrush or QPainterpath problem

    hi,

    I have some items, in my case, arrows, and I'd like to paint a yellow line (using their coords as QPainterPath to paint the lines) but it closes the path at the end.

    There is any way to do it with QPainterPath? or will it always close the path at the end? hoy can I do it if I can't use QPainterPath? (please note I need to have my lines joined with the Qt::PenJoinStyle)

    The arrows:


    What I want:


    But PainterPath comes back to its origins :S

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qpen, QBrush or QPainterpath problem

    It seems to me, that you only have to set Qt::NoBrush on your painter and just use a big pen.
    void QPainterPath::addPolygon ( const QPolygonF & polygon )

    Adds the given polygon to the path as an (unclosed) subpath.

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

    jano_alex_es (14th July 2009)

  4. #3
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Qpen, QBrush or QPainterpath problem

    I was already using a big pen... but I didn't know the QBrush has to "fill the holes"; so I just remove it (I just had because in a future I could need design improvements) and it works fine

    thanks!

Similar Threads

  1. Diff between QBrush and QPen
    By wagmare in forum Qt Programming
    Replies: 5
    Last Post: 16th February 2009, 14:47
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. 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.