Skip to content
Snippets Groups Projects
qwt_plot_dict.h 1.62 KiB
Newer Older
  • Learn to ignore specific revisions
  • pixhawk's avatar
    pixhawk committed
    /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     * Qwt Widget Library
     * Copyright (C) 1997   Josef Wilgen
     * Copyright (C) 2002   Uwe Rathmann
     *
     * This library is free software; you can redistribute it and/or
     * modify it under the terms of the Qwt License, Version 1.0
     *****************************************************************************/
    
    /*! \file !*/
    #ifndef QWT_PLOT_DICT
    #define QWT_PLOT_DICT
    
    #include "qwt_global.h"
    #include "qwt_plot_item.h"
    #include <qlist.h>
    
    Bryant's avatar
    Bryant committed
    
    
    pixhawk's avatar
    pixhawk committed
    /// \var typedef QList< QwtPlotItem *> QwtPlotItemList
    /// \brief See QT 4.x assistant documentation for QList
    typedef QList<QwtPlotItem *> QwtPlotItemList;
    
    Bryant's avatar
    Bryant committed
    typedef QList<QwtPlotItem *>::ConstIterator QwtPlotItemIterator;
    
    pixhawk's avatar
    pixhawk committed
    
    /*!
      \brief A dictionary for plot items
    
      QwtPlotDict organizes plot items in increasing z-order.
      If autoDelete() is enabled, all attached items will be deleted
      in the destructor of the dictionary.
    
    Bryant's avatar
    Bryant committed
      QwtPlotDict can be used to get access to all QwtPlotItem items - or all
      items of a specific type -  that are currently on the plot.
    
    pixhawk's avatar
    pixhawk committed
    
      \sa QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z()
    */
    class QWT_EXPORT QwtPlotDict
    {
    public:
        explicit QwtPlotDict();
    
    Bryant's avatar
    Bryant committed
        virtual ~QwtPlotDict();
    
    pixhawk's avatar
    pixhawk committed
    
    
    Bryant's avatar
    Bryant committed
        void setAutoDelete( bool );
    
    pixhawk's avatar
    pixhawk committed
        bool autoDelete() const;
    
        const QwtPlotItemList& itemList() const;
    
    Bryant's avatar
    Bryant committed
        QwtPlotItemList itemList( int rtti ) const;
    
    pixhawk's avatar
    pixhawk committed
    
    
    Bryant's avatar
    Bryant committed
        void detachItems( int rtti = QwtPlotItem::Rtti_PlotItem,
            bool autoDelete = true );
    
    pixhawk's avatar
    pixhawk committed
    
    
    Bryant's avatar
    Bryant committed
    protected:
        void insertItem( QwtPlotItem * );
        void removeItem( QwtPlotItem * );
    
    pixhawk's avatar
    pixhawk committed
    
    
    Bryant's avatar
    Bryant committed
    private:
    
    pixhawk's avatar
    pixhawk committed
        class PrivateData;
        PrivateData *d_data;
    };
    
    #endif