Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_MAGNIFIER_H
00011 #define QWT_MAGNIFIER_H 1
00012
00013 #include "qwt_global.h"
00014 #include <qobject.h>
00015
00016 class QWidget;
00017 class QMouseEvent;
00018 class QWheelEvent;
00019 class QKeyEvent;
00020
00027 class QWT_EXPORT QwtMagnifier: public QObject
00028 {
00029 Q_OBJECT
00030
00031 public:
00032 explicit QwtMagnifier(QWidget *);
00033 virtual ~QwtMagnifier();
00034
00035 QWidget *parentWidget();
00036 const QWidget *parentWidget() const;
00037
00038 void setEnabled(bool);
00039 bool isEnabled() const;
00040
00041
00042 void setMouseFactor(double);
00043 double mouseFactor() const;
00044
00045 void setMouseButton(int button, int buttonState = Qt::NoButton);
00046 void getMouseButton(int &button, int &buttonState) const;
00047
00048
00049 void setWheelFactor(double);
00050 double wheelFactor() const;
00051
00052 void setWheelButtonState(int buttonState);
00053 int wheelButtonState() const;
00054
00055
00056 void setKeyFactor(double);
00057 double keyFactor() const;
00058
00059 void setZoomInKey(int key, int modifiers);
00060 void getZoomInKey(int &key, int &modifiers) const;
00061
00062 void setZoomOutKey(int key, int modifiers);
00063 void getZoomOutKey(int &key, int &modifiers) const;
00064
00065 virtual bool eventFilter(QObject *, QEvent *);
00066
00067 protected:
00072 virtual void rescale(double factor) = 0;
00073
00074 virtual void widgetMousePressEvent(QMouseEvent *);
00075 virtual void widgetMouseReleaseEvent(QMouseEvent *);
00076 virtual void widgetMouseMoveEvent(QMouseEvent *);
00077 virtual void widgetWheelEvent(QWheelEvent *);
00078 virtual void widgetKeyPressEvent(QKeyEvent *);
00079 virtual void widgetKeyReleaseEvent(QKeyEvent *);
00080
00081 private:
00082 class PrivateData;
00083 PrivateData *d_data;
00084 };
00085
00086 #endif