Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_zoomer.h


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_plot_zoomer.h

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1313#include "qwt_global.h"
    1414#include "qwt_plot_picker.h"
    15 #include <qstack.h>
     15
     16class QSizeF;
     17template< typename T > class QStack;
    1618
    1719/*!
    18   \brief QwtPlotZoomer provides stacked zooming for a plot widget
     20   \brief QwtPlotZoomer provides stacked zooming for a plot widget
    1921
    20   QwtPlotZoomer selects rectangles from user inputs ( mouse or keyboard )
    21   translates them into plot coordinates and adjusts the axes to them.
    22   The selection is supported by a rubber band and optionally by displaying
    23   the coordinates of the current mouse position.
     22   QwtPlotZoomer selects rectangles from user inputs ( mouse or keyboard )
     23   translates them into plot coordinates and adjusts the axes to them.
     24   The selection is supported by a rubber band and optionally by displaying
     25   the coordinates of the current mouse position.
    2426
    25   Zooming can be repeated as often as possible, limited only by
    26   maxStackDepth() or minZoomSize().  Each rectangle is pushed on a stack.
     27   Zooming can be repeated as often as possible, limited only by
     28   maxStackDepth() or minZoomSize().  Each rectangle is pushed on a stack.
    2729
    28   The default setting how to select rectangles is
    29   a QwtPickerDragRectMachine with the following bindings:
     30   The default setting how to select rectangles is
     31   a QwtPickerDragRectMachine with the following bindings:
    3032
    31   - QwtEventPattern::MouseSelect1\n
     33   - QwtEventPattern::MouseSelect1\n
    3234    The first point of the zoom rectangle is selected by a mouse press,
    3335    the second point from the position, where the mouse is released.
    3436
    35   - QwtEventPattern::KeySelect1\n
     37   - QwtEventPattern::KeySelect1\n
    3638    The first key press selects the first, the second key press
    3739    selects the second point.
    3840
    39   - QwtEventPattern::KeyAbort\n
     41   - QwtEventPattern::KeyAbort\n
    4042    Discard the selection in the state, where the first point
    4143    is selected.
    4244
    43   To traverse the zoom stack the following bindings are used:
     45   To traverse the zoom stack the following bindings are used:
    4446
    45   - QwtEventPattern::MouseSelect3, QwtEventPattern::KeyUndo\n
     47   - QwtEventPattern::MouseSelect3, QwtEventPattern::KeyUndo\n
    4648    Zoom out one position on the zoom stack
    4749
    48   - QwtEventPattern::MouseSelect6, QwtEventPattern::KeyRedo\n
     50   - QwtEventPattern::MouseSelect6, QwtEventPattern::KeyRedo\n
    4951    Zoom in one position on the zoom stack
    5052
    51   - QwtEventPattern::MouseSelect2, QwtEventPattern::KeyHome\n
     53   - QwtEventPattern::MouseSelect2, QwtEventPattern::KeyHome\n
    5254    Zoom to the zoom base
    5355
    54   The setKeyPattern() and setMousePattern() functions can be used
    55   to configure the zoomer actions. The following example
    56   shows, how to configure the 'I' and 'O' keys for zooming in and out
    57   one position on the zoom stack. The "Home" key is used to
    58   "unzoom" the plot.
     56   The setKeyPattern() and setMousePattern() functions can be used
     57   to configure the zoomer actions. The following example
     58   shows, how to configure the 'I' and 'O' keys for zooming in and out
     59   one position on the zoom stack. The "Home" key is used to
     60   "unzoom" the plot.
    5961
    60   \code
     62   \code
    6163   zoomer = new QwtPlotZoomer( plot );
    6264   zoomer->setKeyPattern( QwtEventPattern::KeyRedo, Qt::Key_I, Qt::ShiftModifier );
    6365   zoomer->setKeyPattern( QwtEventPattern::KeyUndo, Qt::Key_O, Qt::ShiftModifier );
    6466   zoomer->setKeyPattern( QwtEventPattern::KeyHome, Qt::Key_Home );
    65   \endcode
     67   \endcode
    6668
    67   QwtPlotZoomer is tailored for plots with one x and y axis, but it is
    68   allowed to attach a second QwtPlotZoomer ( without rubber band and tracker )
    69   for the other axes.
     69   QwtPlotZoomer is tailored for plots with one x and y axis, but it is
     70   allowed to attach a second QwtPlotZoomer ( without rubber band and tracker )
     71   for the other axes.
    7072
    71   \note The realtime example includes an derived zoomer class that adds
     73   \note The realtime example includes an derived zoomer class that adds
    7274        scrollbars to the plot canvas.
    7375
    74   \sa QwtPlotPanner, QwtPlotMagnifier
    75 */
     76   \sa QwtPlotPanner, QwtPlotMagnifier
     77 */
    7678
    77 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
     79class QWT_EXPORT QwtPlotZoomer : public QwtPlotPicker
    7880{
    7981    Q_OBJECT
    80 public:
    81     explicit QwtPlotZoomer( QWidget *, bool doReplot = true );
    82     explicit QwtPlotZoomer( int xAxis, int yAxis,
    83                             QWidget *, bool doReplot = true );
     82  public:
     83    explicit QwtPlotZoomer( QWidget*, bool doReplot = true );
     84    explicit QwtPlotZoomer( QwtAxisId xAxis, QwtAxisId yAxis,
     85        QWidget*, bool doReplot = true );
    8486
    8587    virtual ~QwtPlotZoomer();
    8688
    8789    virtual void setZoomBase( bool doReplot = true );
    88     virtual void setZoomBase( const QRectF & );
     90    virtual void setZoomBase( const QRectF& );
    8991
    9092    QRectF zoomBase() const;
    9193    QRectF zoomRect() const;
    9294
    93     virtual void setAxis( int xAxis, int yAxis );
     95    virtual void setAxes( QwtAxisId xAxis, QwtAxisId yAxis ) QWT_OVERRIDE;
    9496
    9597    void setMaxStackDepth( int );
    9698    int maxStackDepth() const;
    9799
    98     const QStack<QRectF> &zoomStack() const;
    99     void setZoomStack( const QStack<QRectF> &,
     100    const QStack< QRectF >& zoomStack() const;
     101    void setZoomStack( const QStack< QRectF >&,
    100102        int zoomRectIndex = -1 );
    101103
    102104    uint zoomRectIndex() const;
    103105
    104 public Q_SLOTS:
     106  public Q_SLOTS:
    105107    void moveBy( double dx, double dy );
    106     virtual void moveTo( const QPointF & );
     108    virtual void moveTo( const QPointF& );
    107109
    108     virtual void zoom( const QRectF & );
     110    virtual void zoom( const QRectF& );
    109111    virtual void zoom( int offset );
    110112
    111 Q_SIGNALS:
     113  Q_SIGNALS:
    112114    /*!
    113       A signal emitting the zoomRect(), when the plot has been
    114       zoomed in or out.
     115       A signal emitting the zoomRect(), when the plot has been
     116       zoomed in or out.
    115117
    116       \param rect Current zoom rectangle.
    117     */
     118       \param rect Current zoom rectangle.
     119     */
    118120
    119     void zoomed( const QRectF &rect );
     121    void zoomed( const QRectF& rect );
    120122
    121 protected:
     123  protected:
    122124    virtual void rescale();
    123125
    124126    virtual QSizeF minZoomSize() const;
    125127
    126     virtual void widgetMouseReleaseEvent( QMouseEvent * );
    127     virtual void widgetKeyPressEvent( QKeyEvent * );
     128    virtual void widgetMouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
     129    virtual void widgetKeyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
    128130
    129     virtual void begin();
    130     virtual bool end( bool ok = true );
    131     virtual bool accept( QPolygon & ) const;
     131    virtual void begin() QWT_OVERRIDE;
     132    virtual bool end( bool ok = true ) QWT_OVERRIDE;
     133    virtual bool accept( QPolygon& ) const QWT_OVERRIDE;
    132134
    133 private:
     135  private:
    134136    void init( bool doReplot );
    135137
    136138    class PrivateData;
    137     PrivateData *d_data;
     139    PrivateData* m_data;
    138140};
    139141
Note: See TracChangeset for help on using the changeset viewer.