70 if ( parent->focusPolicy() == Qt::NoFocus )
71 parent->setFocusPolicy( Qt::WheelFocus );
98 QObject *o = parent();
102 o->installEventFilter(
this );
104 o->removeEventFilter(
this );
203 Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
211 Qt::MouseButton &button, Qt::KeyboardModifiers &modifiers )
const 251 Qt::KeyboardModifiers modifiers )
266 Qt::KeyboardModifiers &modifiers )
const 281 Qt::KeyboardModifiers modifiers )
296 Qt::KeyboardModifiers &modifiers )
const 319 if (
object &&
object == parent() )
321 switch ( event->type() )
323 case QEvent::MouseButtonPress:
328 case QEvent::MouseMove:
333 case QEvent::MouseButtonRelease:
343 case QEvent::KeyPress:
348 case QEvent::KeyRelease:
356 return QObject::eventFilter(
object, event );
392 Q_UNUSED( mouseEvent );
440 #if QT_VERSION < 0x050000 441 const int wheelDelta = wheelEvent->delta();
443 const QPoint delta = wheelEvent->angleDelta();
444 const int wheelDelta = ( qAbs( delta.x() ) > qAbs( delta.y() ) )
445 ? delta.x() : delta.y();
458 qAbs( wheelDelta / 120.0 ) );
460 if ( wheelDelta > 0 )
495 Q_UNUSED( keyEvent );
501 return qobject_cast<QWidget *>( parent() );
507 return qobject_cast<
const QWidget *>( parent() );
511 #include "moc_qwt_magnifier.cpp"
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 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
virtual bool eventFilter(QObject *, QEvent *) QWT_OVERRIDE
Event filter.
void setMouseButton(Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)