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
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    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, 13:00
  2. setRect vs boundingRect
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 5th February 2009, 00:23
  3. Replies: 1
    Last Post: 31st October 2008, 08:26
  4. QGraphicsItem force boundingRect
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 27th September 2008, 16:49
  5. How to avoid calling boundingRect() & shape()
    By nileshsince1980 in forum Qt Programming
    Replies: 7
    Last Post: 8th October 2007, 18: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.