PDA

View Full Version : QGraphicsView - zoom out using the right mouse button



dbrmik
14th April 2009, 12:57
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

wysota
14th April 2009, 23:17
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.