Results 1 to 4 of 4

Thread: Doubt in QGraphicsItem::boundingRect()

  1. #1
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Doubt in QGraphicsItem::boundingRect()

    Are we supposed to accomodate half of the pen width extra for non rectangular items , which draws rect only when selected ?
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Doubt in QGraphicsItem::boundingRect()

    I think yes...
    from the docs...
    Note: For shapes that paint an outline / stroke, it is important to include half the pen width in the bounding rect. It is not necessary to compensate for antialiasing, though.
    Even if u are drawing non rectangular items, the top/bottom or right/left side will touch the rectangle...
    hope i am right

  3. #3
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Smile Re: Doubt in QGraphicsItem::boundingRect()

    You are. Lines, rectangles, ellipses, every shape whose outline touches the bounding rect needs to add half the pen width in boundingRect(). All Qt's standard items do this.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  4. #4
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Doubt in QGraphicsItem::boundingRect()

    Thanks to you both.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

Similar Threads

  1. Doubt ?
    By Cutey in forum Qt Tools
    Replies: 2
    Last Post: 3rd March 2007, 10:45
  2. doubt with this qt's code
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2007, 14:39
  3. QFile doubt
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2006, 12:39
  4. QT 4.1 in OSX I have a doubt
    By askot in forum Installation and Deployment
    Replies: 9
    Last Post: 25th February 2006, 07:14

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.