Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_item.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_item.h

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1212
    1313#include "qwt_global.h"
    14 #include "qwt_text.h"
    15 #include "qwt_legend_data.h"
    16 #include "qwt_graphic.h"
    17 #include <qrect.h>
    18 #include <qlist.h>
     14#include "qwt_axis_id.h"
    1915#include <qmetatype.h>
    2016
    21 class QPainter;
    2217class QwtScaleMap;
    2318class QwtScaleDiv;
    2419class QwtPlot;
     20class QwtText;
     21class QwtGraphic;
     22class QwtLegendData;
     23class QRectF;
     24class QPainter;
     25class QString;
     26template< typename T > class QList;
    2527
    2628/*!
    27   \brief Base class for items on the plot canvas
    28 
    29   A plot item is "something", that can be painted on the plot canvas,
    30   or only affects the scales of the plot widget. They can be categorized as:
    31 
    32   - Representator\n
     29   \brief Base class for items on the plot canvas
     30
     31   A plot item is "something", that can be painted on the plot canvas,
     32   or only affects the scales of the plot widget. They can be categorized as:
     33
     34   - Representator\n
    3335    A "Representator" is an item that represents some sort of data
    3436    on the plot canvas. The different representator classes are organized
    … …  
    4244    - ...
    4345
    44   - Decorators\n
     46   - Decorators\n
    4547    A "Decorator" is an item, that displays additional information, that
    4648    is not related to any data:
    … …  
    5052    - ...
    5153
    52   Depending on the QwtPlotItem::ItemAttribute flags, an item is included
    53   into autoscaling or has an entry on the legend.
    54 
    55   Before misusing the existing item classes it might be better to
    56   implement a new type of plot item
    57   ( don't implement a watermark as spectrogram ).
    58   Deriving a new type of QwtPlotItem primarily means to implement
    59   the YourPlotItem::draw() method.
    60 
    61   \sa The cpuplot example shows the implementation of additional plot items.
    62 */
     54   Depending on the QwtPlotItem::ItemAttribute flags, an item is included
     55   into autoscaling or has an entry on the legend.
     56
     57   Before misusing the existing item classes it might be better to
     58   implement a new type of plot item
     59   ( don't implement a watermark as spectrogram ).
     60   Deriving a new type of QwtPlotItem primarily means to implement
     61   the YourPlotItem::draw() method.
     62
     63   \sa The cpuplot example shows the implementation of additional plot items.
     64 */
    6365
    6466class QWT_EXPORT QwtPlotItem
    6567{
    66 public:
     68  public:
    6769    /*!
    6870        \brief Runtime type information
    … …  
    103105        Rtti_PlotSpectrogram,
    104106
    105         //! For QwtPlotSvgItem
    106         Rtti_PlotSVG,
     107        //! For QwtPlotGraphicItem, QwtPlotSvgItem
     108        Rtti_PlotGraphic,
    107109
    108110        //! For QwtPlotTradingCurve
    … …  
    123125        //! For QwtPlotZoneItem
    124126        Rtti_PlotZone,
     127
     128        //! For QwtPlotVectorField
     129        Rtti_PlotVectorField,
    125130
    126131        /*!
    … …  
    160165    };
    161166
    162     //! Plot Item Attributes
    163     typedef QFlags<ItemAttribute> ItemAttributes;
     167    Q_DECLARE_FLAGS( ItemAttributes, ItemAttribute )
    164168
    165169    /*!
    … …  
    194198    };
    195199
    196     //! Plot Item Interests
    197     typedef QFlags<ItemInterest> ItemInterests;
     200    Q_DECLARE_FLAGS( ItemInterests, ItemInterest )
    198201
    199202    //! Render hints
    … …  
    204207    };
    205208
    206     //! Render hints
    207     typedef QFlags<RenderHint> RenderHints;
    208 
    209     explicit QwtPlotItem( const QwtText &title = QwtText() );
     209    Q_DECLARE_FLAGS( RenderHints, RenderHint )
     210
     211    explicit QwtPlotItem();
     212    explicit QwtPlotItem( const QString& title );
     213    explicit QwtPlotItem( const QwtText& title );
     214
    210215    virtual ~QwtPlotItem();
    211216
    212     void attach( QwtPlot *plot );
     217    void attach( QwtPlot* plot );
    213218    void detach();
    214219
    215     QwtPlot *plot() const;
    216 
    217     void setTitle( const QString &title );
    218     void setTitle( const QwtText &title );
    219     const QwtText &title() const;
     220    QwtPlot* plot() const;
     221
     222    void setTitle( const QString& title );
     223    void setTitle( const QwtText& title );
     224    const QwtText& title() const;
    220225
    221226    virtual int rtti() const;
    … …  
    233238    uint renderThreadCount() const;
    234239
    235     void setLegendIconSize( const QSize & );
     240    void setLegendIconSize( const QSize& );
    236241    QSize legendIconSize() const;
    237242
    … …  
    244249    bool isVisible () const;
    245250
    246     void setAxes( int xAxis, int yAxis );
    247 
    248     void setXAxis( int axis );
    249     int xAxis() const;
    250 
    251     void setYAxis( int axis );
    252     int yAxis() const;
     251    void setAxes( QwtAxisId xAxis, QwtAxisId yAxis );
     252
     253    void setXAxis( QwtAxisId );
     254    QwtAxisId xAxis() const;
     255
     256    void setYAxis( QwtAxisId );
     257    QwtAxisId yAxis() const;
    253258
    254259    virtual void itemChanged();
    … …  
    256261
    257262    /*!
    258       \brief Draw the item
    259 
    260       \param painter Painter
    261       \param xMap Maps x-values into pixel coordinates.
    262       \param yMap Maps y-values into pixel coordinates.
    263       \param canvasRect Contents rect of the canvas in painter coordinates
    264     */
    265     virtual void draw( QPainter *painter,
    266         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    267         const QRectF &canvasRect ) const = 0;
     263       \brief Draw the item
     264
     265       \param painter Painter
     266       \param xMap Maps x-values into pixel coordinates.
     267       \param yMap Maps y-values into pixel coordinates.
     268       \param canvasRect Contents rect of the canvas in painter coordinates
     269     */
     270    virtual void draw( QPainter* painter,
     271        const QwtScaleMap& xMap, const QwtScaleMap& yMap,
     272        const QRectF& canvasRect ) const = 0;
    268273
    269274    virtual QRectF boundingRect() const;
    270275
    271276    virtual void getCanvasMarginHint(
    272         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    273         const QRectF &canvasRect,
    274         double &left, double &top, double &right, double &bottom) const;
     277        const QwtScaleMap& xMap, const QwtScaleMap& yMap,
     278        const QRectF& canvasRect,
     279        double& left, double& top, double& right, double& bottom) const;
    275280
    276281    virtual void updateScaleDiv(
    277282        const QwtScaleDiv&, const QwtScaleDiv& );
    278283
    279     virtual void updateLegend( const QwtPlotItem *,
    280         const QList<QwtLegendData> & );
    281 
    282     QRectF scaleRect( const QwtScaleMap &, const QwtScaleMap & ) const;
    283     QRectF paintRect( const QwtScaleMap &, const QwtScaleMap & ) const;
    284 
    285     virtual QList<QwtLegendData> legendData() const;
    286 
    287     virtual QwtGraphic legendIcon( int index, const QSizeF  & ) const;
    288 
    289 protected:
    290     QwtGraphic defaultIcon( const QBrush &, const QSizeF & ) const;
    291 
    292 private:
    293     // Disabled copy constructor and operator=
    294     QwtPlotItem( const QwtPlotItem & );
    295     QwtPlotItem &operator=( const QwtPlotItem & );
     284    virtual void updateLegend( const QwtPlotItem*,
     285        const QList< QwtLegendData >& );
     286
     287    QRectF scaleRect( const QwtScaleMap&, const QwtScaleMap& ) const;
     288    QRectF paintRect( const QwtScaleMap&, const QwtScaleMap& ) const;
     289
     290    virtual QList< QwtLegendData > legendData() const;
     291
     292    virtual QwtGraphic legendIcon( int index, const QSizeF& ) const;
     293
     294  protected:
     295    QwtGraphic defaultIcon( const QBrush&, const QSizeF& ) const;
     296
     297  private:
     298    Q_DISABLE_COPY(QwtPlotItem)
    296299
    297300    class PrivateData;
    298     PrivateData *d_data;
     301    PrivateData* m_data;
    299302};
    300303
    … …  
    303306Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints )
    304307
    305 Q_DECLARE_METATYPE( QwtPlotItem * )
     308Q_DECLARE_METATYPE( QwtPlotItem* )
    306309
    307310#endif
Note: See TracChangeset for help on using the changeset viewer.