Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_dict.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_plot_dict.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_plot_dict.h"
     11#include <algorithm>
    1112
    1213class QwtPlotDict::PrivateData
    1314{
    14 public:
     15  public:
    1516
    16     class ItemList: public QList<QwtPlotItem *>
     17    class ItemList : public QList< QwtPlotItem* >
    1718    {
    18     public:
    19         void insertItem( QwtPlotItem *item )
     19      public:
     20        void insertItem( QwtPlotItem* item )
    2021        {
    2122            if ( item == NULL )
    2223                return;
    2324
    24             QList<QwtPlotItem *>::iterator it =
    25                 qUpperBound( begin(), end(), item, LessZThan() );
     25            QList< QwtPlotItem* >::iterator it =
     26                std::upper_bound( begin(), end(), item, LessZThan() );
    2627            insert( it, item );
    2728        }
    2829
    29         void removeItem( QwtPlotItem *item )
     30        void removeItem( QwtPlotItem* item )
    3031        {
    3132            if ( item == NULL )
    3233                return;
    3334
    34             QList<QwtPlotItem *>::iterator it =
    35                 qLowerBound( begin(), end(), item, LessZThan() );
     35            QList< QwtPlotItem* >::iterator it =
     36                std::lower_bound( begin(), end(), item, LessZThan() );
    3637
    3738            for ( ; it != end(); ++it )
    … …  
    4445            }
    4546        }
    46     private:
     47      private:
    4748        class LessZThan
    4849        {
    49         public:
    50             inline bool operator()( const QwtPlotItem *item1,
    51                 const QwtPlotItem *item2 ) const
     50          public:
     51            inline bool operator()( const QwtPlotItem* item1,
     52                const QwtPlotItem* item2 ) const
    5253            {
    5354                return item1->z() < item2->z();
    … …  
    6566   Auto deletion is enabled.
    6667   \sa setAutoDelete(), QwtPlotItem::attach()
    67 */
     68 */
    6869QwtPlotDict::QwtPlotDict()
    6970{
    70     d_data = new QwtPlotDict::PrivateData;
    71     d_data->autoDelete = true;
     71    m_data = new QwtPlotDict::PrivateData;
     72    m_data->autoDelete = true;
    7273}
    7374
    … …  
    7778   If autoDelete() is on, all attached items will be deleted
    7879   \sa setAutoDelete(), autoDelete(), QwtPlotItem::attach()
    79 */
     80 */
    8081QwtPlotDict::~QwtPlotDict()
    8182{
    82     detachItems( QwtPlotItem::Rtti_PlotItem, d_data->autoDelete );
    83     delete d_data;
     83    detachItems( QwtPlotItem::Rtti_PlotItem, m_data->autoDelete );
     84    delete m_data;
    8485}
    8586
    … …  
    9192
    9293   \sa autoDelete(), insertItem()
    93 */
     94 */
    9495void QwtPlotDict::setAutoDelete( bool autoDelete )
    9596{
    96     d_data->autoDelete = autoDelete;
     97    m_data->autoDelete = autoDelete;
    9798}
    9899
    … …  
    100101   \return true if auto deletion is enabled
    101102   \sa setAutoDelete(), insertItem()
    102 */
     103 */
    103104bool QwtPlotDict::autoDelete() const
    104105{
    105     return d_data->autoDelete;
     106    return m_data->autoDelete;
    106107}
    107108
    108109/*!
    109   Insert a plot item
     110   Insert a plot item
    110111
    111   \param item PlotItem
    112   \sa removeItem()
     112   \param item PlotItem
     113   \sa removeItem()
    113114 */
    114 void QwtPlotDict::insertItem( QwtPlotItem *item )
     115void QwtPlotDict::insertItem( QwtPlotItem* item )
    115116{
    116     d_data->itemList.insertItem( item );
     117    m_data->itemList.insertItem( item );
    117118}
    118119
    119120/*!
    120   Remove a plot item
     121   Remove a plot item
    121122
    122   \param item PlotItem
    123   \sa insertItem()
     123   \param item PlotItem
     124   \sa insertItem()
    124125 */
    125 void QwtPlotDict::removeItem( QwtPlotItem *item )
     126void QwtPlotDict::removeItem( QwtPlotItem* item )
    126127{
    127     d_data->itemList.removeItem( item );
     128    m_data->itemList.removeItem( item );
    128129}
    129130
    … …  
    134135               otherwise only those items of the type rtti.
    135136   \param autoDelete If true, delete all detached items
    136 */
     137 */
    137138void QwtPlotDict::detachItems( int rtti, bool autoDelete )
    138139{
    139     PrivateData::ItemList list = d_data->itemList;
     140    PrivateData::ItemList list = m_data->itemList;
    140141    QwtPlotItemIterator it = list.constBegin();
    141142    while ( it != list.constEnd() )
    142143    {
    143         QwtPlotItem *item = *it;
     144        QwtPlotItem* item = *it;
    144145
    145146        ++it; // increment before removing item from the list
    … …  
    155156
    156157/*!
    157   \brief A QwtPlotItemList of all attached plot items.
     158   \brief A QwtPlotItemList of all attached plot items.
    158159
    159   Use caution when iterating these lists, as removing/detaching an item will
    160   invalidate the iterator. Instead you can place pointers to objects to be
    161   removed in a removal list, and traverse that list later.
     160   Use caution when iterating these lists, as removing/detaching an item will
     161   invalidate the iterator. Instead you can place pointers to objects to be
     162   removed in a removal list, and traverse that list later.
    162163
    163   \return List of all attached plot items.
    164 */
    165 const QwtPlotItemList &QwtPlotDict::itemList() const
     164   \return List of all attached plot items.
     165 */
     166const QwtPlotItemList& QwtPlotDict::itemList() const
    166167{
    167     return d_data->itemList;
     168    return m_data->itemList;
    168169}
    169170
    170171/*!
    171   \return List of all attached plot items of a specific type.
    172   \param rtti See QwtPlotItem::RttiValues
    173   \sa QwtPlotItem::rtti()
    174 */
     172   \return List of all attached plot items of a specific type.
     173   \param rtti See QwtPlotItem::RttiValues
     174   \sa QwtPlotItem::rtti()
     175 */
    175176QwtPlotItemList QwtPlotDict::itemList( int rtti ) const
    176177{
    177178    if ( rtti == QwtPlotItem::Rtti_PlotItem )
    178         return d_data->itemList;
     179        return m_data->itemList;
    179180
    180181    QwtPlotItemList items;
    181182
    182     PrivateData::ItemList list = d_data->itemList;
     183    PrivateData::ItemList list = m_data->itemList;
    183184    for ( QwtPlotItemIterator it = list.constBegin(); it != list.constEnd(); ++it )
    184185    {
    185         QwtPlotItem *item = *it;
     186        QwtPlotItem* item = *it;
    186187        if ( item->rtti() == rtti )
    187188            items += item;
Note: See TracChangeset for help on using the changeset viewer.