qwt_plot_panner.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  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. #ifndef QWT_PLOT_PANNER_H
  10. #define QWT_PLOT_PANNER_H 1
  11. #include "qwt_global.h"
  12. #include "qwt_panner.h"
  13. class QwtPlot;
  14. /*!
  15. \brief QwtPlotPanner provides panning of a plot canvas
  16. QwtPlotPanner is a panner for a plot canvas, that
  17. adjusts the scales of the axes after dropping
  18. the canvas on its new position.
  19. Together with QwtPlotZoomer and QwtPlotMagnifier powerful ways
  20. of navigating on a QwtPlot widget can be implemented easily.
  21. \note The axes are not updated, while dragging the canvas
  22. \sa QwtPlotZoomer, QwtPlotMagnifier
  23. */
  24. class QWT_EXPORT QwtPlotPanner: public QwtPanner
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit QwtPlotPanner( QWidget * );
  29. virtual ~QwtPlotPanner();
  30. QWidget *canvas();
  31. const QWidget *canvas() const;
  32. QwtPlot *plot();
  33. const QwtPlot *plot() const;
  34. void setAxisEnabled( int axis, bool on );
  35. bool isAxisEnabled( int axis ) const;
  36. protected Q_SLOTS:
  37. virtual void moveCanvas( int dx, int dy );
  38. protected:
  39. virtual QBitmap contentsMask() const;
  40. virtual QPixmap grab() const;
  41. private:
  42. class PrivateData;
  43. PrivateData *d_data;
  44. };
  45. #endif