Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_ZOOMER_H
00011 #define QWT_PLOT_ZOOMER_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_plot_picker.h"
00015
00016 class QSizeF;
00017 template <typename T> class QStack;
00018
00079 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
00080 {
00081 Q_OBJECT
00082 public:
00083 explicit QwtPlotZoomer( QWidget *, bool doReplot = true );
00084 explicit QwtPlotZoomer( int xAxis, int yAxis,
00085 QWidget *, bool doReplot = true );
00086
00087 virtual ~QwtPlotZoomer();
00088
00089 virtual void setZoomBase( bool doReplot = true );
00090 virtual void setZoomBase( const QRectF & );
00091
00092 QRectF zoomBase() const;
00093 QRectF zoomRect() const;
00094
00095 virtual void setAxis( int xAxis, int yAxis ) override;
00096
00097 void setMaxStackDepth( int );
00098 int maxStackDepth() const;
00099
00100 const QStack<QRectF> &zoomStack() const;
00101 void setZoomStack( const QStack<QRectF> &,
00102 int zoomRectIndex = -1 );
00103
00104 uint zoomRectIndex() const;
00105
00106 public Q_SLOTS:
00107 void moveBy( double dx, double dy );
00108 virtual void moveTo( const QPointF & );
00109
00110 virtual void zoom( const QRectF & );
00111 virtual void zoom( int offset );
00112
00113 Q_SIGNALS:
00121 void zoomed( const QRectF &rect );
00122
00123 protected:
00124 virtual void rescale();
00125
00126 virtual QSizeF minZoomSize() const;
00127
00128 virtual void widgetMouseReleaseEvent( QMouseEvent * ) override;
00129 virtual void widgetKeyPressEvent( QKeyEvent * ) override;
00130
00131 virtual void begin() override;
00132 virtual bool end( bool ok = true ) override;
00133 virtual bool accept( QPolygon & ) const override;
00134
00135 private:
00136 void init( bool doReplot );
00137
00138 class PrivateData;
00139 PrivateData *d_data;
00140 };
00141
00142 #endif