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


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

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_graphic.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_null_paintdevice.h"
     15
    1516#include <qmetatype.h>
    16 #include <qimage.h>
    17 #include <qpixmap.h>
    1817
    1918class QwtPainterCommand;
     19class QPixmap;
     20class QImage;
    2021
    2122/*!
    … …  
    7273    \sa QwtPainterCommand
    7374 */
    74 class QWT_EXPORT QwtGraphic: public QwtNullPaintDevice
     75class QWT_EXPORT QwtGraphic : public QwtNullPaintDevice
    7576{
    76 public:
     77  public:
    7778    /*!
    7879        Hint how to render a graphic
    … …  
    9697    };
    9798
     99    Q_DECLARE_FLAGS( RenderHints, RenderHint )
     100
    98101    /*!
    99         \brief Render hints
    100 
    101         The default setting is to disable all hints
     102       Indicator if the graphic contains a specific type of painter command
     103       \sa CommandTypes, commandTypes();
    102104     */
    103     typedef QFlags<RenderHint> RenderHints;
     105    enum CommandType
     106    {
     107        //! The graphic contains scalable vector data
     108        VectorData     = 1 << 0,
     109
     110        //! The graphic contains raster data ( QPixmap or QImage )
     111        RasterData     = 1 << 1,
     112
     113        //! The graphic contains transformations beyond simple translations
     114        Transformation = 1 << 2
     115    };
     116
     117    Q_DECLARE_FLAGS( CommandTypes, CommandType )
    104118
    105119    QwtGraphic();
    106     QwtGraphic( const QwtGraphic & );
     120    QwtGraphic( const QwtGraphic& );
    107121
    108122    virtual ~QwtGraphic();
    109123
    110     QwtGraphic& operator=( const QwtGraphic & );
     124    QwtGraphic& operator=( const QwtGraphic& );
    111125
    112126    void reset();
    … …  
    115129    bool isEmpty() const;
    116130
    117     void render( QPainter * ) const;
    118 
    119     void render( QPainter *, const QSizeF &,
    120             Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    121 
    122     void render( QPainter *, const QRectF &,
    123             Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    124 
    125     void render( QPainter *, const QPointF &,
     131    CommandTypes commandTypes() const;
     132
     133    void render( QPainter* ) const;
     134
     135    void render( QPainter*, const QSizeF&,
     136        Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
     137
     138    void render( QPainter*, const QPointF&,
    126139        Qt::Alignment = Qt::AlignTop | Qt::AlignLeft ) const;
    127140
    128     QPixmap toPixmap() const;
    129     QPixmap toPixmap( const QSize &,
    130         Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    131 
    132     QImage toImage() const;
    133     QImage toImage( const QSize &,
    134         Qt::AspectRatioMode = Qt::IgnoreAspectRatio  ) const;
    135 
    136     QRectF scaledBoundingRect( double sx, double sy ) const;
     141    void render( QPainter*, const QRectF&,
     142        Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
     143
     144    QPixmap toPixmap( qreal devicePixelRatio = 0.0 ) const;
     145
     146    QPixmap toPixmap( const QSize&,
     147        Qt::AspectRatioMode = Qt::IgnoreAspectRatio,
     148        qreal devicePixelRatio = 0.0 ) const;
     149
     150    QImage toImage( qreal devicePixelRatio = 0.0 ) const;
     151
     152    QImage toImage( const QSize&,
     153        Qt::AspectRatioMode = Qt::IgnoreAspectRatio,
     154        qreal devicePixelRatio = 0.0 ) const;
     155
     156    QRectF scaledBoundingRect( qreal sx, qreal sy ) const;
    137157
    138158    QRectF boundingRect() const;
    139159    QRectF controlPointRect() const;
    140160
    141     const QVector< QwtPainterCommand > &commands() const;
    142     void setCommands( QVector< QwtPainterCommand > & );
    143 
    144     void setDefaultSize( const QSizeF & );
     161    const QVector< QwtPainterCommand >& commands() const;
     162    void setCommands( const QVector< QwtPainterCommand >& );
     163
     164    void setDefaultSize( const QSizeF& );
    145165    QSizeF defaultSize() const;
     166
     167    qreal heightForWidth( qreal width ) const;
     168    qreal widthForHeight( qreal height ) const;
    146169
    147170    void setRenderHint( RenderHint, bool on = true );
    148171    bool testRenderHint( RenderHint ) const;
    149172
    150 protected:
    151     virtual QSize sizeMetrics() const;
    152 
    153     virtual void drawPath( const QPainterPath & );
    154 
    155     virtual void drawPixmap( const QRectF &,
    156         const QPixmap &, const QRectF & );
    157 
    158     virtual void drawImage( const QRectF &,
    159         const QImage &, const QRectF &, Qt::ImageConversionFlags );
    160 
    161     virtual void updateState( const QPaintEngineState &state );
    162 
    163 private:
    164     void updateBoundingRect( const QRectF & );
    165     void updateControlPointRect( const QRectF & );
     173    RenderHints renderHints() const;
     174
     175  protected:
     176    virtual QSize sizeMetrics() const QWT_OVERRIDE;
     177
     178    virtual void drawPath( const QPainterPath& ) QWT_OVERRIDE;
     179
     180    virtual void drawPixmap( const QRectF&,
     181        const QPixmap&, const QRectF& ) QWT_OVERRIDE;
     182
     183    virtual void drawImage( const QRectF&, const QImage&,
     184        const QRectF&, Qt::ImageConversionFlags ) QWT_OVERRIDE;
     185
     186    virtual void updateState( const QPaintEngineState& ) QWT_OVERRIDE;
     187
     188  private:
     189    void renderGraphic( QPainter*, QTransform* ) const;
     190
     191    void updateBoundingRect( const QRectF& );
     192    void updateControlPointRect( const QRectF& );
    166193
    167194    class PathInfo;
    168195
    169196    class PrivateData;
    170     PrivateData *d_data;
     197    PrivateData* m_data;
    171198};
    172199
    173200Q_DECLARE_OPERATORS_FOR_FLAGS( QwtGraphic::RenderHints )
     201Q_DECLARE_OPERATORS_FOR_FLAGS( QwtGraphic::CommandTypes )
    174202Q_DECLARE_METATYPE( QwtGraphic )
    175203
Note: See TracChangeset for help on using the changeset viewer.