Results 1 to 7 of 7

Thread: boundingRect()?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default boundingRect()?

    Dear all,
    In my program, I draw a line via two points, the line's parent class is QGraphicsItem.
    I want to select a line when it is under mouse, but the boundingRect is not my expection.
    The real boundingRect likes the rectangel(red line) in figure_1(left) , otherwise, I want to get the boundingRect likes figure_2(right). If I uses boundingRect likes figure_1, when I move mouse to the rectangle, the line(cyan line) will be selected, but, it is not under mouse currsor.
    According to the Qt4's manual, I re-implement the two pure virsual function: boundingRect() && paint(...), if I do not use boundingRect(), How can I do it?
    Thanks a lot !
    Attached Images Attached Images

Similar Threads

  1. How to realiably create the boundingRect()
    By zarkzervo in forum Qt Programming
    Replies: 1
    Last Post: 19th February 2009, 14:00
  2. setRect vs boundingRect
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 5th February 2009, 01:23
  3. Replies: 1
    Last Post: 31st October 2008, 09:26
  4. QGraphicsItem force boundingRect
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 27th September 2008, 17:49
  5. How to avoid calling boundingRect() & shape()
    By nileshsince1980 in forum Qt Programming
    Replies: 7
    Last Post: 8th October 2007, 19:10

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.