[89] | 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 |
|
---|
| 10 | // vim: expandtab
|
---|
| 11 |
|
---|
| 12 | /*! \file !*/
|
---|
| 13 | #ifndef QWT_PLOT_DICT
|
---|
| 14 | #define QWT_PLOT_DICT
|
---|
| 15 |
|
---|
| 16 | #include "qwt_global.h"
|
---|
| 17 | #include "qwt_plot_item.h"
|
---|
| 18 |
|
---|
| 19 | #if QT_VERSION < 0x040000
|
---|
| 20 | #include <qvaluelist.h>
|
---|
| 21 | typedef QValueListConstIterator<QwtPlotItem *> QwtPlotItemIterator;
|
---|
| 22 | /// \var typedef QValueList< QwtPlotItem *> QwtPlotItemList
|
---|
| 23 | /// \brief See QT 3.x assistant documentation for QValueList
|
---|
| 24 | typedef QValueList<QwtPlotItem *> QwtPlotItemList;
|
---|
| 25 | #else
|
---|
| 26 | #include <qlist.h>
|
---|
| 27 | typedef QList<QwtPlotItem *>::ConstIterator QwtPlotItemIterator;
|
---|
| 28 | /// \var typedef QList< QwtPlotItem *> QwtPlotItemList
|
---|
| 29 | /// \brief See QT 4.x assistant documentation for QList
|
---|
| 30 | typedef QList<QwtPlotItem *> QwtPlotItemList;
|
---|
| 31 | #endif
|
---|
| 32 |
|
---|
| 33 | /*!
|
---|
| 34 | \brief A dictionary for plot items
|
---|
| 35 |
|
---|
| 36 | QwtPlotDict organizes plot items in increasing z-order.
|
---|
| 37 | If autoDelete() is enabled, all attached items will be deleted
|
---|
| 38 | in the destructor of the dictionary.
|
---|
| 39 |
|
---|
| 40 | \sa QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z()
|
---|
| 41 | */
|
---|
| 42 | class QWT_EXPORT QwtPlotDict
|
---|
| 43 | {
|
---|
| 44 | public:
|
---|
| 45 | explicit QwtPlotDict();
|
---|
| 46 | ~QwtPlotDict();
|
---|
| 47 |
|
---|
| 48 | void setAutoDelete(bool);
|
---|
| 49 | bool autoDelete() const;
|
---|
| 50 |
|
---|
| 51 | const QwtPlotItemList& itemList() const;
|
---|
| 52 |
|
---|
| 53 | void detachItems(int rtti = QwtPlotItem::Rtti_PlotItem,
|
---|
| 54 | bool autoDelete = true);
|
---|
| 55 |
|
---|
| 56 | private:
|
---|
| 57 | friend class QwtPlotItem;
|
---|
| 58 |
|
---|
| 59 | void attachItem(QwtPlotItem *, bool);
|
---|
| 60 |
|
---|
| 61 | class PrivateData;
|
---|
| 62 | PrivateData *d_data;
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | #endif
|
---|