Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_canvas.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_canvas.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_plot_abstract_canvas.h"
     15
    1416#include <qframe.h>
    15 #include <qpainterpath.h>
    1617
    1718class QwtPlot;
    1819class QPixmap;
     20class QPainterPath;
    1921
    2022/*!
    21   \brief Canvas of a QwtPlot.
     23   \brief Canvas of a QwtPlot.
    2224
    2325   Canvas is the widget where all plot items are displayed
    2426
    25   \sa QwtPlot::setCanvas(), QwtPlotGLCanvas
    26 */
    27 class QWT_EXPORT QwtPlotCanvas : public QFrame
     27   \sa QwtPlot::setCanvas(), QwtPlotGLCanvas, QwtPlotOpenGLCanvas
     28 */
     29class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
    2830{
    2931    Q_OBJECT
    … …  
    3133    Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
    3234
    33 public:
     35  public:
    3436
    3537    /*!
    36       \brief Paint attributes
     38       \brief Paint attributes
    3739
    38       The default setting enables BackingStore and Opaque.
     40       The default setting enables BackingStore and Opaque.
    3941
    40       \sa setPaintAttribute(), testPaintAttribute()
     42       \sa setPaintAttribute(), testPaintAttribute()
    4143     */
    4244    enum PaintAttribute
    4345    {
    4446        /*!
    45           \brief Paint double buffered reusing the content
     47           \brief Paint double buffered reusing the content
    4648                 of the pixmap buffer when possible.
    4749
    48           Using a backing store might improve the performance
    49           significantly, when working with widget overlays ( like rubber bands ).
    50           Disabling the cache might improve the performance for
    51           incremental paints (using QwtPlotDirectPainter ).
     50           Using a backing store might improve the performance
     51           significantly, when working with widget overlays ( like rubber bands ).
     52           Disabling the cache might improve the performance for
     53           incremental paints (using QwtPlotDirectPainter ).
    5254
    53           \sa backingStore(), invalidateBackingStore()
     55           \sa backingStore(), invalidateBackingStore()
    5456         */
    5557        BackingStore = 1,
    5658
    5759        /*!
    58           \brief Try to fill the complete contents rectangle
     60           \brief Try to fill the complete contents rectangle
    5961                 of the plot canvas
    6062
    61           When using styled backgrounds Qt assumes, that the
    62           canvas doesn't fill its area completely
    63           ( f.e because of rounded borders ) and fills the area
    64           below the canvas. When this is done with gradients it might
    65           result in a serious performance bottleneck - depending on the size.
     63           When using styled backgrounds Qt assumes, that the
     64           canvas doesn't fill its area completely
     65           ( f.e because of rounded borders ) and fills the area
     66           below the canvas. When this is done with gradients it might
     67           result in a serious performance bottleneck - depending on the size.
    6668
    67           When the Opaque attribute is enabled the canvas tries to
    68           identify the gaps with some heuristics and to fill those only.
     69           When the Opaque attribute is enabled the canvas tries to
     70           identify the gaps with some heuristics and to fill those only.
    6971
    70           \warning Will not work for semitransparent backgrounds
     72           \warning Will not work for semitransparent backgrounds
    7173         */
    7274        Opaque       = 2,
    7375
    7476        /*!
    75           \brief Try to improve painting of styled backgrounds
     77           \brief Try to improve painting of styled backgrounds
    7678
    77           QwtPlotCanvas supports the box model attributes for
    78           customizing the layout with style sheets. Unfortunately
    79           the design of Qt style sheets has no concept how to
    80           handle backgrounds with rounded corners - beside of padding.
     79           QwtPlotCanvas supports the box model attributes for
     80           customizing the layout with style sheets. Unfortunately
     81           the design of Qt style sheets has no concept how to
     82           handle backgrounds with rounded corners - beside of padding.
    8183
    82           When HackStyledBackground is enabled the plot canvas tries
    83           to separate the background from the background border
    84           by reverse engineering to paint the background before and
    85           the border after the plot items. In this order the border
    86           gets perfectly antialiased and you can avoid some pixel
    87           artifacts in the corners.
     84           When HackStyledBackground is enabled the plot canvas tries
     85           to separate the background from the background border
     86           by reverse engineering to paint the background before and
     87           the border after the plot items. In this order the border
     88           gets perfectly antialiased and you can avoid some pixel
     89           artifacts in the corners.
    8890         */
    8991        HackStyledBackground = 4,
    9092
    9193        /*!
    92           When ImmediatePaint is set replot() calls repaint()
    93           instead of update().
     94           When ImmediatePaint is set replot() calls repaint()
     95           instead of update().
    9496
    95           \sa replot(), QWidget::repaint(), QWidget::update()
     97           \sa replot(), QWidget::repaint(), QWidget::update()
    9698         */
    9799        ImmediatePaint = 8
    98100    };
    99101
    100     //! Paint attributes
    101     typedef QFlags<PaintAttribute> PaintAttributes;
     102    Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
    102103
    103     /*!
    104       \brief Focus indicator
    105       The default setting is NoFocusIndicator
    106       \sa setFocusIndicator(), focusIndicator(), drawFocusIndicator()
    107     */
    108 
    109     enum FocusIndicator
    110     {
    111         //! Don't paint a focus indicator
    112         NoFocusIndicator,
    113 
    114         /*!
    115           The focus is related to the complete canvas.
    116           Paint the focus indicator using drawFocusIndicator()
    117          */
    118         CanvasFocusIndicator,
    119 
    120         /*!
    121           The focus is related to an item (curve, point, ...) on
    122           the canvas. It is up to the application to display a
    123           focus indication using f.e. highlighting.
    124          */
    125         ItemFocusIndicator
    126     };
    127 
    128     explicit QwtPlotCanvas( QwtPlot * = NULL );
     104    explicit QwtPlotCanvas( QwtPlot* = NULL );
    129105    virtual ~QwtPlotCanvas();
    130 
    131     QwtPlot *plot();
    132     const QwtPlot *plot() const;
    133 
    134     void setFocusIndicator( FocusIndicator );
    135     FocusIndicator focusIndicator() const;
    136 
    137     void setBorderRadius( double );
    138     double borderRadius() const;
    139106
    140107    void setPaintAttribute( PaintAttribute, bool on = true );
    141108    bool testPaintAttribute( PaintAttribute ) const;
    142109
    143     const QPixmap *backingStore() const;
    144     void invalidateBackingStore();
     110    const QPixmap* backingStore() const;
     111    Q_INVOKABLE void invalidateBackingStore();
    145112
    146     virtual bool event( QEvent * );
     113    virtual bool event( QEvent* ) QWT_OVERRIDE;
    147114
    148     Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
     115    Q_INVOKABLE QPainterPath borderPath( const QRect& ) const;
    149116
    150 public Q_SLOTS:
     117  public Q_SLOTS:
    151118    void replot();
    152119
    153 protected:
    154     virtual void paintEvent( QPaintEvent * );
    155     virtual void resizeEvent( QResizeEvent * );
     120  protected:
     121    virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
     122    virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
    156123
    157     virtual void drawFocusIndicator( QPainter * );
    158     virtual void drawBorder( QPainter * );
     124    virtual void drawBorder( QPainter* ) QWT_OVERRIDE;
    159125
    160     void updateStyleSheetInfo();
    161 
    162 private:
    163     void drawCanvas( QPainter *, bool withBackground );
    164 
     126  private:
    165127    class PrivateData;
    166     PrivateData *d_data;
     128    PrivateData* m_data;
    167129};
    168130
Note: See TracChangeset for help on using the changeset viewer.