qwt_plot_dict.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * Qwt Widget Library
  3. * Copyright (C) 1997 Josef Wilgen
  4. * Copyright (C) 2002 Uwe Rathmann
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Qwt License, Version 1.0
  8. *****************************************************************************/
  9. /*! \file !*/
  10. #ifndef QWT_PLOT_DICT
  11. #define QWT_PLOT_DICT
  12. #include "qwt_global.h"
  13. #include "qwt_plot_item.h"
  14. #include <qlist.h>
  15. /// \var typedef QList< QwtPlotItem *> QwtPlotItemList
  16. /// \brief See QT 4.x assistant documentation for QList
  17. typedef QList<QwtPlotItem *> QwtPlotItemList;
  18. typedef QList<QwtPlotItem *>::ConstIterator QwtPlotItemIterator;
  19. /*!
  20. \brief A dictionary for plot items
  21. QwtPlotDict organizes plot items in increasing z-order.
  22. If autoDelete() is enabled, all attached items will be deleted
  23. in the destructor of the dictionary.
  24. QwtPlotDict can be used to get access to all QwtPlotItem items - or all
  25. items of a specific type - that are currently on the plot.
  26. \sa QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z()
  27. */
  28. class QWT_EXPORT QwtPlotDict
  29. {
  30. public:
  31. explicit QwtPlotDict();
  32. virtual ~QwtPlotDict();
  33. void setAutoDelete( bool );
  34. bool autoDelete() const;
  35. const QwtPlotItemList& itemList() const;
  36. QwtPlotItemList itemList( int rtti ) const;
  37. void detachItems( int rtti = QwtPlotItem::Rtti_PlotItem,
  38. bool autoDelete = true );
  39. protected:
  40. void insertItem( QwtPlotItem * );
  41. void removeItem( QwtPlotItem * );
  42. private:
  43. class PrivateData;
  44. PrivateData *d_data;
  45. };
  46. #endif