69 if ( parent->focusPolicy() == Qt::NoFocus )
70 parent->setFocusPolicy( Qt::WheelFocus );
97 QObject *
o = parent();
101 o->installEventFilter(
this );
103 o->removeEventFilter(
this );
202 Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
210 Qt::MouseButton &button, Qt::KeyboardModifiers &modifiers )
const 250 Qt::KeyboardModifiers modifiers )
265 Qt::KeyboardModifiers &modifiers )
const 280 Qt::KeyboardModifiers modifiers )
295 Qt::KeyboardModifiers &modifiers )
const 318 if (
object &&
object == parent() )
320 switch ( event->type() )
322 case QEvent::MouseButtonPress:
327 case QEvent::MouseMove:
332 case QEvent::MouseButtonRelease:
342 case QEvent::KeyPress:
347 case QEvent::KeyRelease:
355 return QObject::eventFilter(
object, event );
391 Q_UNUSED( mouseEvent );
449 qAbs( wheelEvent->delta() / 120.0 ) );
451 if ( wheelEvent->delta() > 0 )
486 Q_UNUSED( keyEvent );
492 return qobject_cast<QWidget *>( parent() );
498 return qobject_cast<
const QWidget *>( parent() );
double mouseFactor() const
virtual void widgetMousePressEvent(QMouseEvent *)
virtual void rescale(double factor)=0
void setWheelFactor(double)
Change the wheel factor.
void setKeyFactor(double)
Change the key factor.
virtual void widgetWheelEvent(QWheelEvent *)
void setMouseFactor(double)
Change the mouse factor.
Qt::KeyboardModifiers wheelModifiers() const
void setWheelModifiers(Qt::KeyboardModifiers)
Qt::KeyboardModifiers wheelModifiers
Qt::MouseButton mouseButton
virtual ~QwtMagnifier()
Destructor.
void setEnabled(bool)
En/disable the magnifier.
void setZoomInKey(int key, Qt::KeyboardModifiers=Qt::NoModifier)
void getZoomOutKey(int &key, Qt::KeyboardModifiers &) const
Retrieve the settings of the zoom out key.
virtual bool eventFilter(QObject *, QEvent *)
Event filter.
virtual void widgetMouseReleaseEvent(QMouseEvent *)
void setZoomOutKey(int key, Qt::KeyboardModifiers=Qt::NoModifier)
Qt::KeyboardModifiers zoomInKeyModifiers
double wheelFactor() const
virtual void widgetMouseMoveEvent(QMouseEvent *)
Qt::KeyboardModifiers mouseButtonModifiers
virtual void widgetKeyReleaseEvent(QKeyEvent *)
Qt::KeyboardModifiers zoomOutKeyModifiers
virtual void widgetKeyPressEvent(QKeyEvent *)
void getZoomInKey(int &key, Qt::KeyboardModifiers &) const
Retrieve the settings of the zoom in key.
void getMouseButton(Qt::MouseButton &, Qt::KeyboardModifiers &) const
void setMouseButton(Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)