1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
10
#ifndef QWT_MAGNIFIER_H
11
#define QWT_MAGNIFIER_H 1
13
#include "qwt_global.h"
22
\brief QwtMagnifier provides zooming, by magnifying in steps.
24
Using QwtMagnifier a plot can be zoomed in/out in steps using
25
keys, the mouse wheel or moving a mouse button in vertical direction.
27
class QWT_EXPORT QwtMagnifier: public QObject
32
explicit QwtMagnifier(QWidget *);
33
virtual ~QwtMagnifier();
35
QWidget *parentWidget();
36
const QWidget *parentWidget() const;
38
void setEnabled(bool);
39
bool isEnabled() const;
42
void setMouseFactor(double);
43
double mouseFactor() const;
45
void setMouseButton(int button, int buttonState = Qt::NoButton);
46
void getMouseButton(int &button, int &buttonState) const;
49
void setWheelFactor(double);
50
double wheelFactor() const;
52
void setWheelButtonState(int buttonState);
53
int wheelButtonState() const;
56
void setKeyFactor(double);
57
double keyFactor() const;
59
void setZoomInKey(int key, int modifiers);
60
void getZoomInKey(int &key, int &modifiers) const;
62
void setZoomOutKey(int key, int modifiers);
63
void getZoomOutKey(int &key, int &modifiers) const;
65
virtual bool eventFilter(QObject *, QEvent *);
69
Rescale the parent widget
70
\param factor Scale factor
72
virtual void rescale(double factor) = 0;
74
virtual void widgetMousePressEvent(QMouseEvent *);
75
virtual void widgetMouseReleaseEvent(QMouseEvent *);
76
virtual void widgetMouseMoveEvent(QMouseEvent *);
77
virtual void widgetWheelEvent(QWheelEvent *);
78
virtual void widgetKeyPressEvent(QKeyEvent *);
79
virtual void widgetKeyReleaseEvent(QKeyEvent *);