I`m creating a plot widget based on QwtPlot that has three buttons to toggle zoom-in, zoom-out, and panning/draggin (like in matlab). How can I change the mouse bindings? I have slots that are called when the different buttons are toggled. I want to set the left mouse-button to handle everything depending on which button is toggled: zoom in when zoom-in is toggled, zoom out when zoom-out is toggled, and pan/drag the plot when the pan-button is toggled. So far I`ve tried
setMousePattern(QwtEventPattern::MouseSelect3,Qt:: LeftButton); // when pan is toggled

setMousePattern(QwtEventPattern::MouseSelect2,Qt:: LeftButton); // when zoom-out is toggled

setMousePattern(QwtEventPattern::MouseSelect1,Qt:: LeftButton); // when zoom-in is toggled

but it doesn`t give me the right behaviour. I don`t want to zoom-out using right-clicks as that button is used for conext-menu. And not all mouses have a mid-button for panning...