Results 1 to 2 of 2

Thread: QGraphicsView - zoom out using the right mouse button

  1. #1
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView - zoom out using the right mouse button

    Hi

    I have a QGraphicsView subclass and have implemented rubberband 'zoom in' using the left mouse button, which works fine. I would like to implement 'zoom out' using the right mouse button. (similar in functionality to the Qwt Plot Zoomer)

    What is the best way of achieving this?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsView - zoom out using the right mouse button

    Override mouseReleaseEvent() for the view, check for the proper button and zoom out. You can keep a zoom history somewhere in the view so that you can "undo" the last zoom.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 10th October 2011, 16:55
  2. QSlider and right mouse button
    By Abnormalia in forum Qt Programming
    Replies: 4
    Last Post: 17th March 2009, 12:13
  3. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  4. problem about mouse button events
    By vql in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2008, 10:14
  5. Replies: 3
    Last Post: 4th December 2007, 10:04

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.