gaganbm
7th February 2013, 11:43
Hello,
I have a Main Window and within it I have a bunch of UI elements like tab browsers, graphview and so on. It has been created using Qt Creator and not by explicitily making class objects for each component and adding it to the Main Window.
I want to add wheelEvent for zoom in and zoom out actions on the GraphView section. But it effects the whole window. That is, I want the zoom-in and zoom-out to happen only when the WheelEvent is done in the graph view. But at present, anywhere in the main window I do the scrolling, the zooming takes place.
How do I restrict the WheelEvent only to the graphview ? One way I thought was to capture the mouse position somehow and check if it is within the GraphView and then proceed. Secondly, may be adding the graphview as a separate class and instantiating it in the Main Window, and deleting it from the Qt Creator ui form.
Please suggest how to achieve this.
Thank you.
I have a Main Window and within it I have a bunch of UI elements like tab browsers, graphview and so on. It has been created using Qt Creator and not by explicitily making class objects for each component and adding it to the Main Window.
I want to add wheelEvent for zoom in and zoom out actions on the GraphView section. But it effects the whole window. That is, I want the zoom-in and zoom-out to happen only when the WheelEvent is done in the graph view. But at present, anywhere in the main window I do the scrolling, the zooming takes place.
How do I restrict the WheelEvent only to the graphview ? One way I thought was to capture the mouse position somehow and check if it is within the GraphView and then proceed. Secondly, may be adding the graphview as a separate class and instantiating it in the Main Window, and deleting it from the Qt Creator ui form.
Please suggest how to achieve this.
Thank you.