Results 1 to 20 of 22

Thread: How can both graphicsView and graphicsItem receive mousemoveEvent?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    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: How can both graphicsView and graphicsItem receive mousemoveEvent?

    In short what I understand is you want to zoom into the scene / view with rubberband effect.

    I dont think you have to go to items level for that. What you need to do is - catch mouse events in your scene / view. Draw the rubberband in mouse move events, and finally on mouse release event you capture a rect, from the mousepress(x,y) and mouserelease(x,y).
    Now you convert this rect in to scene rect, and call QGraphicsView::fitInView()
    Thats it, you are zoomed in :-) , and you only had to capture events in the view

  2. The following user says thank you to aamer4yu for this useful post:

    christina123y (15th March 2009)

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.