A dictionary for plot items. More...
#include <qwt_plot_dict.h>
Classes | |
class | PrivateData |
Public Member Functions | |
bool | autoDelete () const |
void | detachItems (int rtti=QwtPlotItem::Rtti_PlotItem, bool autoDelete=true) |
const QwtPlotItemList & | itemList () const |
A QwtPlotItemList of all attached plot items. More... | |
QwtPlotItemList | itemList (int rtti) const |
QwtPlotDict () | |
void | setAutoDelete (bool) |
virtual | ~QwtPlotDict () |
Protected Member Functions | |
void | insertItem (QwtPlotItem *) |
void | removeItem (QwtPlotItem *) |
Private Attributes | |
PrivateData * | m_data |
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. QwtPlotDict can be used to get access to all QwtPlotItem items - or all items of a specific type - that are currently on the plot.
Definition at line 32 of file qwt_plot_dict.h.
|
explicit |
Constructor
Auto deletion is enabled.
Definition at line 69 of file qwt_plot_dict.cpp.
|
virtual |
Destructor
If autoDelete() is on, all attached items will be deleted
Definition at line 81 of file qwt_plot_dict.cpp.
bool QwtPlotDict::autoDelete | ( | ) | const |
Definition at line 104 of file qwt_plot_dict.cpp.
void QwtPlotDict::detachItems | ( | int | rtti = QwtPlotItem::Rtti_PlotItem , |
bool | autoDelete = true |
||
) |
Detach items from the dictionary
rtti | In case of QwtPlotItem::Rtti_PlotItem detach all items otherwise only those items of the type rtti. |
autoDelete | If true, delete all detached items |
Definition at line 138 of file qwt_plot_dict.cpp.
|
protected |
Insert a plot item
item | PlotItem |
Definition at line 115 of file qwt_plot_dict.cpp.
const QwtPlotItemList & QwtPlotDict::itemList | ( | ) | const |
A QwtPlotItemList of all attached plot items.
Use caution when iterating these lists, as removing/detaching an item will invalidate the iterator. Instead you can place pointers to objects to be removed in a removal list, and traverse that list later.
Definition at line 166 of file qwt_plot_dict.cpp.
QwtPlotItemList QwtPlotDict::itemList | ( | int | rtti | ) | const |
rtti | See QwtPlotItem::RttiValues |
Definition at line 176 of file qwt_plot_dict.cpp.
|
protected |
Remove a plot item
item | PlotItem |
Definition at line 126 of file qwt_plot_dict.cpp.
void QwtPlotDict::setAutoDelete | ( | bool | autoDelete | ) |
En/Disable Auto deletion
If Auto deletion is on all attached plot items will be deleted in the destructor of QwtPlotDict. The default value is on.
Definition at line 95 of file qwt_plot_dict.cpp.
|
private |
Definition at line 52 of file qwt_plot_dict.h.