Hi,
When I use QwtPlotMagnifier for zooming, it assigns the right mouse button for zooming in and out when u hold right mouse button and move up/down. How do I disable this so that I can use it for the QwtPlotZoomer rubberband? Thank you.
-James
Printable View
Hi,
When I use QwtPlotMagnifier for zooming, it assigns the right mouse button for zooming in and out when u hold right mouse button and move up/down. How do I disable this so that I can use it for the QwtPlotZoomer rubberband? Thank you.
-James
Thanks Uwe,
The solution is to do:
mMagnify->setMouseButton(QwtEventPattern::MouseSelect6, Qt::NoButton);
I didn't realize that MouseSelect6 was the one I need to set, thanks
No, QwtEventPattern::MousePatternCode has absolutely nothing to do with the parameter you have to set in QwtMagnifier::setMouseButton. MouseSelect6 is simply the 6th enum value and is mapped to 5 by the compiler, what might be a value, that does what you want - but this by accident and passing the 6th value of any other enum (or a blank 5 ) would have the same effect.
The values you have to use are those you find in a QMouseEvent:
Code:
{ d_data->mouseButton = button; d_data->mouseButtonState = buttonState; } { if ( me->button() != d_data->mouseButton || parentWidget() == NULL ) return; if ( (me->modifiers() & Qt::KeyboardModifierMask) != (int)(d_data->mouseButtonState & Qt::KeyboardModifierMask) ) { return; } ... }
Uwe