qwt_plot_dict.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. \sa QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z()
  25. */
  26. class QWT_EXPORT QwtPlotDict
  27. {
  28. public:
  29. explicit QwtPlotDict();
  30. virtual ~QwtPlotDict();
  31. void setAutoDelete( bool );
  32. bool autoDelete() const;
  33. const QwtPlotItemList& itemList() const;
  34. QwtPlotItemList itemList( int rtti ) const;
  35. void detachItems( int rtti = QwtPlotItem::Rtti_PlotItem,
  36. bool autoDelete = true );
  37. private:
  38. friend class QwtPlotItem;
  39. void attachItem( QwtPlotItem *, bool );
  40. class PrivateData;
  41. PrivateData *d_data;
  42. };
  43. #endif