Qwt User's Guide 6.2.0

qwt_plot_zoomer.h
1 /******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
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 *****************************************************************************/
9
10 #ifndef QWT_PLOT_ZOOMER_H
11 #define QWT_PLOT_ZOOMER_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_picker.h"
15
16 class QSizeF;
17 template< typename T > class QStack;
18
79 class QWT_EXPORT QwtPlotZoomer : public QwtPlotPicker
80 {
81 Q_OBJECT
82 public:
83 explicit QwtPlotZoomer( QWidget*, bool doReplot = true );
84 explicit QwtPlotZoomer( QwtAxisId xAxis, QwtAxisId yAxis,
85 QWidget*, bool doReplot = true );
86
87 virtual ~QwtPlotZoomer();
88
89 virtual void setZoomBase( bool doReplot = true );
90 virtual void setZoomBase( const QRectF& );
91
92 QRectF zoomBase() const;
93 QRectF zoomRect() const;
94
95 virtual void setAxes( QwtAxisId xAxis, QwtAxisId yAxis ) QWT_OVERRIDE;
96
97 void setMaxStackDepth( int );
98 int maxStackDepth() const;
99
100 const QStack< QRectF >& zoomStack() const;
101 void setZoomStack( const QStack< QRectF >&,
102 int zoomRectIndex = -1 );
103
104 uint zoomRectIndex() const;
105
106 public Q_SLOTS:
107 void moveBy( double dx, double dy );
108 virtual void moveTo( const QPointF& );
109
110 virtual void zoom( const QRectF& );
111 virtual void zoom( int offset );
112
113 Q_SIGNALS:
121 void zoomed( const QRectF& rect );
122
123 protected:
124 virtual void rescale();
125
126 virtual QSizeF minZoomSize() const;
127
128 virtual void widgetMouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
129 virtual void widgetKeyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
130
131 virtual void begin() QWT_OVERRIDE;
132 virtual bool end( bool ok = true ) QWT_OVERRIDE;
133 virtual bool accept( QPolygon& ) const QWT_OVERRIDE;
134
135 private:
136 void init( bool doReplot );
137
138 class PrivateData;
139 PrivateData* m_data;
140 };
141
142 #endif
QStack
Definition: qwt_plot_zoomer.h:17
QwtPicker::begin
virtual void begin()
Definition: qwt_picker.cpp:1239
QwtPicker::widgetMouseReleaseEvent
virtual void widgetMouseReleaseEvent(QMouseEvent *)
Definition: qwt_picker.cpp:1050
QwtPicker::widgetKeyPressEvent
virtual void widgetKeyPressEvent(QKeyEvent *)
Definition: qwt_picker.cpp:1112
QwtPlotPicker
QwtPlotPicker provides selections on a plot canvas.
Definition: qwt_plot_picker.h:34
QwtPlotPicker::setAxes
virtual void setAxes(QwtAxisId xAxisId, QwtAxisId yAxisId)
Definition: qwt_plot_picker.cpp:172
QwtPlotZoomer
QwtPlotZoomer provides stacked zooming for a plot widget.
Definition: qwt_plot_zoomer.h:80
QwtPlotZoomer::zoomed
void zoomed(const QRectF &rect)