Results 1 to 4 of 4

Thread: Panning

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    31
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Panning

    Hi,

    I need to implement panning, so i have reimplemented the MousePress ,MoveEvent and MouseReleaseEvent of my View,

    I also need to know if mouse moves over my scene , or my custom item.
    Similarly i need to know if they are pressed or released.

    I have done the job in view, scene and item but only the slots of view works, what could be the issue?

    Is my view eating up the events, do i need to call any function to do this?

  2. #2
    Join Date
    Dec 2008
    Posts
    31
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Panning

    Probably my query was little complex...

    what i need is ,
    I need to re-implement, MouseMove, Press , Release Events in all the view, scene and item classes , is it possible?

    If i move my mouse on the screen, i need to capture in View, Scene and all items at that position is it possible?

    Looking forward to responses ....

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Panning

    QGraphicsView already has panning/scrolling functionality. Set the drag mode. Look at "Colliding Mice" demo for an example. If you want to know if the mouse is over an item, then implement hoverEnterEvent() and hoverLeaveEvent() for the item.

  4. #4
    Join Date
    Dec 2008
    Posts
    31
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Panning

    Thanks for the reply, i have done that now.

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.