Results 1 to 5 of 5

Thread: excluding an area from painting using clip path

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Location
    Berlin
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default excluding an area from painting using clip path

    Hi,

    I'm in the process of porting an MFC/GDI+ application to QT. So far it was fairly smooth, but now I have a problem with clipping. I need to be able to exclude an area from painting.

    In GDI this is done with the flag CombineModeExclude like this:

    ....paint dark rectagle....

    ...add hexagon points to "pointList"...

    GraphicsPath path(FillModeAlternate);
    path.AddPolygon(pointList, count);
    graphics.SetClip(&path, CombineModeExclude);

    ...paint bright rectangle...


    That creates something like this:


    The hexagon is the path that is excluded from clipping. Qt doens't seem to provide something similar among it's flags in enum Qt::ClipOperation. I can include areas, but not exclude.

    Does anyone have a workaround or an idea how to achieve this in Qt?
    Last edited by berliner; 11th May 2009 at 22:12.

Similar Threads

  1. Compute the area under a curve
    By giusepped in forum Qwt
    Replies: 0
    Last Post: 26th December 2008, 06:56
  2. leaveEvent on transparent area issue
    By nooky59 in forum Qt Programming
    Replies: 10
    Last Post: 8th January 2008, 13:22
  3. Replies: 3
    Last Post: 13th November 2007, 10:30
  4. Initialise toolbar in a different area
    By georgie in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2006, 03:49
  5. QRubberBand painting in the scroll area widget
    By SkripT in forum Qt Programming
    Replies: 7
    Last Post: 17th January 2006, 16:48

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.