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_painter_command.cpp

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1111
    1212//! Construct an invalid command
    13 QwtPainterCommand::QwtPainterCommand():
    14     d_type( Invalid )
     13QwtPainterCommand::QwtPainterCommand()
     14    : m_type( Invalid )
    1515{
    1616}
    1717
    1818//! Copy constructor
    19 QwtPainterCommand::QwtPainterCommand( const QPainterPath &path ):
    20     d_type( Path )
    21 {
    22     d_path = new QPainterPath( path );
    23 }
    24 
    25 /*!
    26   Constructor for Pixmap paint operation
    27 
    28   \param rect Target rectangle
    29   \param pixmap Pixmap
    30   \param subRect Rectangle inside the pixmap
    31 
    32   \sa QPainter::drawPixmap()
    33  */
    34 QwtPainterCommand::QwtPainterCommand( const QRectF &rect,
    35         const QPixmap &pixmap, const QRectF& subRect ):
    36     d_type( Pixmap )
    37 {
    38     d_pixmapData = new PixmapData();
    39     d_pixmapData->rect = rect;
    40     d_pixmapData->pixmap = pixmap;
    41     d_pixmapData->subRect = subRect;
    42 }
    43 
    44 /*!
    45   Constructor for Image paint operation
    46 
    47   \param rect Target rectangle
    48   \param image Image
    49   \param subRect Rectangle inside the image
    50   \param flags Conversion flags
    51 
    52   \sa QPainter::drawImage()
    53  */
    54 QwtPainterCommand::QwtPainterCommand( const QRectF &rect,
    55         const QImage &image, const QRectF& subRect,
    56         Qt::ImageConversionFlags flags ):
    57     d_type( Image )
    58 {
    59     d_imageData = new ImageData();
    60     d_imageData->rect = rect;
    61     d_imageData->image = image;
    62     d_imageData->subRect = subRect;
    63     d_imageData->flags = flags;
    64 }
    65 
    66 /*!
    67   Constructor for State paint operation
    68   \param state Paint engine state
    69  */
    70 QwtPainterCommand::QwtPainterCommand( const QPaintEngineState &state ):
    71     d_type( State )
    72 {
    73     d_stateData = new StateData();
    74 
    75     d_stateData->flags = state.state();
    76 
    77     if ( d_stateData->flags & QPaintEngine::DirtyPen )
    78         d_stateData->pen = state.pen();
    79 
    80     if ( d_stateData->flags & QPaintEngine::DirtyBrush )
    81         d_stateData->brush = state.brush();
    82 
    83     if ( d_stateData->flags & QPaintEngine::DirtyBrushOrigin )
    84         d_stateData->brushOrigin = state.brushOrigin();
    85 
    86     if ( d_stateData->flags & QPaintEngine::DirtyFont )
    87         d_stateData->font = state.font();
    88 
    89     if ( d_stateData->flags & QPaintEngine::DirtyBackground )
    90     {
    91         d_stateData->backgroundMode = state.backgroundMode();
    92         d_stateData->backgroundBrush = state.backgroundBrush();
    93     }
    94 
    95     if ( d_stateData->flags & QPaintEngine::DirtyTransform )
    96         d_stateData->transform = state.transform();
    97 
    98     if ( d_stateData->flags & QPaintEngine::DirtyClipEnabled )
    99         d_stateData->isClipEnabled = state.isClipEnabled();
    100 
    101     if ( d_stateData->flags & QPaintEngine::DirtyClipRegion )
    102     {
    103         d_stateData->clipRegion = state.clipRegion();
    104         d_stateData->clipOperation = state.clipOperation();
    105     }
    106 
    107     if ( d_stateData->flags & QPaintEngine::DirtyClipPath )
    108     {
    109         d_stateData->clipPath = state.clipPath();
    110         d_stateData->clipOperation = state.clipOperation();
    111     }
    112 
    113     if ( d_stateData->flags & QPaintEngine::DirtyHints )
    114         d_stateData->renderHints = state.renderHints();
    115 
    116     if ( d_stateData->flags & QPaintEngine::DirtyCompositionMode )
    117         d_stateData->compositionMode = state.compositionMode();
    118 
    119     if ( d_stateData->flags & QPaintEngine::DirtyOpacity )
    120         d_stateData->opacity = state.opacity();
    121 }
    122 
    123 /*!
    124   Copy constructor
    125   \param other Command to be copied
    126 
    127  */
    128 QwtPainterCommand::QwtPainterCommand(const QwtPainterCommand &other)
     19QwtPainterCommand::QwtPainterCommand( const QPainterPath& path )
     20    : m_type( Path )
     21{
     22    m_path = new QPainterPath( path );
     23}
     24
     25/*!
     26   Constructor for Pixmap paint operation
     27
     28   \param rect Target rectangle
     29   \param pixmap Pixmap
     30   \param subRect Rectangle inside the pixmap
     31
     32   \sa QPainter::drawPixmap()
     33 */
     34QwtPainterCommand::QwtPainterCommand( const QRectF& rect,
     35        const QPixmap& pixmap, const QRectF& subRect )
     36    : m_type( Pixmap )
     37{
     38    m_pixmapData = new PixmapData();
     39    m_pixmapData->rect = rect;
     40    m_pixmapData->pixmap = pixmap;
     41    m_pixmapData->subRect = subRect;
     42}
     43
     44/*!
     45   Constructor for Image paint operation
     46
     47   \param rect Target rectangle
     48   \param image Image
     49   \param subRect Rectangle inside the image
     50   \param flags Conversion flags
     51
     52   \sa QPainter::drawImage()
     53 */
     54QwtPainterCommand::QwtPainterCommand( const QRectF& rect,
     55        const QImage& image, const QRectF& subRect,
     56        Qt::ImageConversionFlags flags )
     57    : m_type( Image )
     58{
     59    m_imageData = new ImageData();
     60    m_imageData->rect = rect;
     61    m_imageData->image = image;
     62    m_imageData->subRect = subRect;
     63    m_imageData->flags = flags;
     64}
     65
     66/*!
     67   Constructor for State paint operation
     68   \param state Paint engine state
     69 */
     70QwtPainterCommand::QwtPainterCommand( const QPaintEngineState& state )
     71    : m_type( State )
     72{
     73    m_stateData = new StateData();
     74
     75    m_stateData->flags = state.state();
     76
     77    if ( m_stateData->flags & QPaintEngine::DirtyPen )
     78        m_stateData->pen = state.pen();
     79
     80    if ( m_stateData->flags & QPaintEngine::DirtyBrush )
     81        m_stateData->brush = state.brush();
     82
     83    if ( m_stateData->flags & QPaintEngine::DirtyBrushOrigin )
     84        m_stateData->brushOrigin = state.brushOrigin();
     85
     86    if ( m_stateData->flags & QPaintEngine::DirtyFont )
     87        m_stateData->font = state.font();
     88
     89    if ( m_stateData->flags & QPaintEngine::DirtyBackground )
     90    {
     91        m_stateData->backgroundMode = state.backgroundMode();
     92        m_stateData->backgroundBrush = state.backgroundBrush();
     93    }
     94
     95    if ( m_stateData->flags & QPaintEngine::DirtyTransform )
     96        m_stateData->transform = state.transform();
     97
     98    if ( m_stateData->flags & QPaintEngine::DirtyClipEnabled )
     99        m_stateData->isClipEnabled = state.isClipEnabled();
     100
     101    if ( m_stateData->flags & QPaintEngine::DirtyClipRegion )
     102    {
     103        m_stateData->clipRegion = state.clipRegion();
     104        m_stateData->clipOperation = state.clipOperation();
     105    }
     106
     107    if ( m_stateData->flags & QPaintEngine::DirtyClipPath )
     108    {
     109        m_stateData->clipPath = state.clipPath();
     110        m_stateData->clipOperation = state.clipOperation();
     111    }
     112
     113    if ( m_stateData->flags & QPaintEngine::DirtyHints )
     114        m_stateData->renderHints = state.renderHints();
     115
     116    if ( m_stateData->flags & QPaintEngine::DirtyCompositionMode )
     117        m_stateData->compositionMode = state.compositionMode();
     118
     119    if ( m_stateData->flags & QPaintEngine::DirtyOpacity )
     120        m_stateData->opacity = state.opacity();
     121}
     122
     123/*!
     124   Copy constructor
     125   \param other Command to be copied
     126
     127 */
     128QwtPainterCommand::QwtPainterCommand( const QwtPainterCommand& other )
    129129{
    130130    copy( other );
    … …  
    138138
    139139/*!
    140   Assignment operator
    141 
    142   \param other Command to be copied
    143   \return Modified command
    144  */
    145 QwtPainterCommand &QwtPainterCommand::operator=(const QwtPainterCommand &other)
     140   Assignment operator
     141
     142   \param other Command to be copied
     143   \return Modified command
     144 */
     145QwtPainterCommand& QwtPainterCommand::operator=( const QwtPainterCommand& other )
    146146{
    147147    reset();
    … …  
    151151}
    152152
    153 void QwtPainterCommand::copy( const QwtPainterCommand &other )
    154 {
    155     d_type = other.d_type;
    156 
    157     switch( other.d_type )
     153void QwtPainterCommand::copy( const QwtPainterCommand& other )
     154{
     155    m_type = other.m_type;
     156
     157    switch( other.m_type )
    158158    {
    159159        case Path:
    160160        {
    161             d_path = new QPainterPath( *other.d_path );
     161            m_path = new QPainterPath( *other.m_path );
    162162            break;
    163163        }
    164164        case Pixmap:
    165165        {
    166             d_pixmapData = new PixmapData( *other.d_pixmapData );
     166            m_pixmapData = new PixmapData( *other.m_pixmapData );
    167167            break;
    168168        }
    169169        case Image:
    170170        {
    171             d_imageData = new ImageData( *other.d_imageData );
     171            m_imageData = new ImageData( *other.m_imageData );
    172172            break;
    173173        }
    174174        case State:
    175175        {
    176             d_stateData = new StateData( *other.d_stateData );
     176            m_stateData = new StateData( *other.m_stateData );
    177177            break;
    178178        }
    … …  
    184184void QwtPainterCommand::reset()
    185185{
    186     switch( d_type )
     186    switch( m_type )
    187187    {
    188188        case Path:
    189189        {
    190             delete d_path;
     190            delete m_path;
    191191            break;
    192192        }
    193193        case Pixmap:
    194194        {
    195             delete d_pixmapData;
     195            delete m_pixmapData;
    196196            break;
    197197        }
    198198        case Image:
    199199        {
    200             delete d_imageData;
     200            delete m_imageData;
    201201            break;
    202202        }
    203203        case State:
    204204        {
    205             delete d_stateData;
     205            delete m_stateData;
    206206            break;
    207207        }
    … …  
    210210    }
    211211
    212     d_type = Invalid;
     212    m_type = Invalid;
    213213}
    214214
    215215//! \return Painter path to be painted
    216 QPainterPath *QwtPainterCommand::path()
    217 {
    218     return d_path;
     216QPainterPath* QwtPainterCommand::path()
     217{
     218    return m_path;
    219219}
    220220
    … …  
    222222QwtPainterCommand::PixmapData* QwtPainterCommand::pixmapData()
    223223{
    224     return d_pixmapData;
     224    return m_pixmapData;
    225225}
    226226
    … …  
    228228QwtPainterCommand::ImageData* QwtPainterCommand::imageData()
    229229{
    230     return d_imageData;
     230    return m_imageData;
    231231}
    232232
    … …  
    234234QwtPainterCommand::StateData* QwtPainterCommand::stateData()
    235235{
    236     return d_stateData;
    237 }
     236    return m_stateData;
     237}
Note: See TracChangeset for help on using the changeset viewer.