Results 1 to 8 of 8

Thread: Clipping with QRegion(QBitmap());

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Clipping with QRegion(QBitmap());

    Hi,

    (I thought I posted this post before but I can't find it, so if this is a double post please merge)
    I would like to clip the corners or a dialog widget (which is QWidget) in order to have round corners.
    Since the size of the dialog can be changed, I need to clip each conrner when the widget is being redrawn. (instead of using a mask on the whole dialog)
    I read the docs about clipping, but I didn't quite understand how I can do that...
    I know I can clip a region with a QPainter, and I know i can generate any kind of mask using a QRegion that takes a QBitmap as argument.
    But what I don't understand is, when I construct QRect(QBitmap()) then how can I position my QRect in x,y position where I want to clip my widget (i.e upper right corner)?

    Thanks.

    EDIT: I just though maybe setClipRect() and setClipRegion() can be used in conjunction... I'll try that.
    Last edited by high_flyer; 24th April 2006 at 19:54.

Similar Threads

  1. Fast Clipping [SOLUTION]
    By maverick_pol in forum Qt Programming
    Replies: 14
    Last Post: 24th October 2008, 12:30
  2. Optimizing polygon clipping in QGraphicsScene drawing
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2008, 20:41
  3. QCanvas clipping problems
    By ksierens in forum Qt Programming
    Replies: 5
    Last Post: 19th September 2007, 16:04
  4. Qt 4.3.0 clipping problem?
    By macbeth in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2007, 17:56
  5. QPainter clipping with precision behind the decimal point
    By Pieter from Belgium in forum Qt Programming
    Replies: 0
    Last Post: 14th March 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
  •  
Qt is a trademark of The Qt Company.