Qwt User's Guide svn
qwt_plot_zoomer.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
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 #include <qstack.h>
00016 
00041 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
00042 {
00043     Q_OBJECT
00044 public:
00045     explicit QwtPlotZoomer( QwtPlotCanvas *, bool doReplot = true );
00046     explicit QwtPlotZoomer( int xAxis, int yAxis,
00047                             QwtPlotCanvas *, bool doReplot = true );
00048 
00049     virtual ~QwtPlotZoomer();
00050 
00051     virtual void setZoomBase( bool doReplot = true );
00052     virtual void setZoomBase( const QRectF & );
00053 
00054     QRectF zoomBase() const;
00055     QRectF zoomRect() const;
00056 
00057     virtual void setAxis( int xAxis, int yAxis );
00058 
00059     void setMaxStackDepth( int );
00060     int maxStackDepth() const;
00061 
00062     const QStack<QRectF> &zoomStack() const;
00063     void setZoomStack( const QStack<QRectF> &,
00064         int zoomRectIndex = -1 );
00065 
00066     uint zoomRectIndex() const;
00067 
00068 public Q_SLOTS:
00069     void moveBy( double x, double y );
00070     virtual void moveTo( const QPointF & );
00071 
00072     virtual void zoom( const QRectF & );
00073     virtual void zoom( int up );
00074 
00075 Q_SIGNALS:
00083     void zoomed( const QRectF &rect );
00084 
00085 protected:
00086     virtual void rescale();
00087 
00088     virtual QSizeF minZoomSize() const;
00089 
00090     virtual void widgetMouseReleaseEvent( QMouseEvent * );
00091     virtual void widgetKeyPressEvent( QKeyEvent * );
00092 
00093     virtual void begin();
00094     virtual bool end( bool ok = true );
00095     virtual bool accept( QPolygon & ) const;
00096 
00097 private:
00098     void init( bool doReplot );
00099 
00100     class PrivateData;
00101     PrivateData *d_data;
00102 };
00103 
00104 #endif
qmi style