Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
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
16class QSizeF;
17template< typename T > class QStack;
18
79class 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
virtual void begin()
virtual void widgetMouseReleaseEvent(QMouseEvent *)
virtual void widgetKeyPressEvent(QKeyEvent *)
QwtPlotPicker provides selections on a plot canvas.
virtual void setAxes(QwtAxisId xAxisId, QwtAxisId yAxisId)
QwtPlotZoomer provides stacked zooming for a plot widget.
void zoomed(const QRectF &rect)