Results 1 to 3 of 3

Thread: Some problem while fill color in QPainterPath

  1. #1
    Join Date
    Aug 2014
    Posts
    1
    Qt products
    Qt4

    Default Some problem while fill color in QPainterPath

    I draw a QPainterPath like left side in attachment picture.
    I want to fill some color, like black. I use QPainter::fillPath(), but what i get is like the right side in picture.
    Only arc part can be filled. I cant understand why?
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Some problem while fill color in QPainterPath

    Try to change the fillRule

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,316
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Some problem while fill color in QPainterPath

    Also ensure that the start of the rectangular section of the path begins at the end of the arc and not the beginning. Also make sure you have a closed path.

Similar Threads

  1. Replies: 5
    Last Post: 17th December 2014, 12:07
  2. Fill area of QPainterPath
    By vides2012 in forum Qt Programming
    Replies: 6
    Last Post: 17th June 2011, 13:00
  3. Replies: 1
    Last Post: 9th May 2011, 15:19
  4. multiple color in QPainterPath
    By edwardc in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2010, 08:37
  5. How to fill the grid with the color?
    By merry in forum Qt Programming
    Replies: 3
    Last Post: 18th June 2007, 11:10

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.