Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_legend_data.cpp


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

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    99
    1010#include "qwt_legend_data.h"
     11#include "qwt_text.h"
     12#include "qwt_graphic.h"
    1113
    1214//! Constructor
    … …  
    2123
    2224/*!
    23   Set the legend attributes
     25   Set the legend attributes
    2426
    25   QwtLegendData actually is a QMap<int, QVariant> with some
    26   convenience interfaces
     27   QwtLegendData actually is a QMap<int, QVariant> with some
     28   convenience interfaces
    2729
    28   \param map Values
    29   \sa values()
     30   \param map Values
     31   \sa values()
    3032 */
    31 void QwtLegendData::setValues( const QMap<int, QVariant> &map )
     33void QwtLegendData::setValues( const QMap< int, QVariant >& map )
    3234{
    33     d_map = map;
     35    m_map = map;
    3436}
    3537
    3638/*!
    37   \return Legend attributes
    38   \sa setValues()
     39   \return Legend attributes
     40   \sa setValues()
    3941 */
    40 const QMap<int, QVariant> &QwtLegendData::values() const
     42const QMap< int, QVariant >& QwtLegendData::values() const
    4143{
    42     return d_map;
     44    return m_map;
    4345}
    4446
    4547/*!
    46   \param role Attribute role
    47   \return True, when the internal map has an entry for role
     48   \param role Attribute role
     49   \return True, when the internal map has an entry for role
    4850 */
    4951bool QwtLegendData::hasRole( int role ) const
    5052{
    51     return d_map.contains( role );
     53    return m_map.contains( role );
    5254}
    5355
    5456/*!
    55   Set an attribute value
     57   Set an attribute value
    5658
    57   \param role Attribute role
    58   \param data Attribute value
     59   \param role Attribute role
     60   \param data Attribute value
    5961
    60   \sa value()
     62   \sa value()
    6163 */
    62 void QwtLegendData::setValue( int role, const QVariant &data )
     64void QwtLegendData::setValue( int role, const QVariant& data )
    6365{
    64     d_map[role] = data;
     66    m_map[role] = data;
    6567}
    6668
    6769/*!
    68   \param role Attribute role
    69   \return Attribute value for a specific role
     70   \param role Attribute role
     71   \return Attribute value for a specific role
    7072 */
    7173QVariant QwtLegendData::value( int role ) const
    7274{
    73     if ( !d_map.contains( role ) )
     75    if ( !m_map.contains( role ) )
    7476        return QVariant();
    7577
    76     return d_map[role];
     78    return m_map[role];
    7779}
    7880
    … …  
    8082bool QwtLegendData::isValid() const
    8183{
    82     return !d_map.isEmpty();
     84    return !m_map.isEmpty();
    8385}
    8486
    … …  
    8991
    9092    const QVariant titleValue = value( QwtLegendData::TitleRole );
    91     if ( titleValue.canConvert<QwtText>() )
     93    if ( titleValue.canConvert< QwtText >() )
    9294    {
    93         text = qvariant_cast<QwtText>( titleValue );
     95        text = qvariant_cast< QwtText >( titleValue );
    9496    }
    95     else if ( titleValue.canConvert<QString>() )
     97    else if ( titleValue.canConvert< QString >() )
    9698    {
    97         text.setText( qvariant_cast<QString>( titleValue ) );
     99        text.setText( qvariant_cast< QString >( titleValue ) );
    98100    }
    99101
    … …  
    107109
    108110    QwtGraphic graphic;
    109     if ( iconValue.canConvert<QwtGraphic>() )
     111    if ( iconValue.canConvert< QwtGraphic >() )
    110112    {
    111         graphic = qvariant_cast<QwtGraphic>( iconValue );
     113        graphic = qvariant_cast< QwtGraphic >( iconValue );
    112114    }
    113115
    … …  
    119121{
    120122    const QVariant modeValue = value( QwtLegendData::ModeRole );
    121     if ( modeValue.canConvert<int>() )
     123    if ( modeValue.canConvert< int >() )
    122124    {
    123         const int mode = qvariant_cast<int>( modeValue );
    124         return static_cast<QwtLegendData::Mode>( mode );
     125        const int mode = qvariant_cast< int >( modeValue );
     126        return static_cast< QwtLegendData::Mode >( mode );
    125127    }
    126128
Note: See TracChangeset for help on using the changeset viewer.