Originally Posted by
jmsbc
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:
void QwtMagnifier::setMouseButton(int button,
int buttonState
) {
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;
}
...
}
void QwtMagnifier::setMouseButton(int button, int buttonState)
{
d_data->mouseButton = button;
d_data->mouseButtonState = buttonState;
}
void QwtMagnifier::widgetMousePressEvent(QMouseEvent *me)
{
if ( me->button() != d_data->mouseButton || parentWidget() == NULL )
return;
if ( (me->modifiers() & Qt::KeyboardModifierMask) !=
(int)(d_data->mouseButtonState & Qt::KeyboardModifierMask) )
{
return;
}
...
}
To copy to clipboard, switch view to plain text mode
Uwe
Bookmarks