Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | List of all members
QwtPlotDict Class Reference

A dictionary for plot items. More...

`#include <qwt_plot_dict.h>`

Inheritance diagram for QwtPlotDict:
[legend]

## Public Member Functions
| QwtPlotDict ()
virtual | ~QwtPlotDict ()
void | setAutoDelete (bool)
bool | autoDelete () const
const QwtPlotItemList & | itemList () const
| A QwtPlotItemList of all attached plot items. More...
QwtPlotItemList | itemList (int rtti) const
void | detachItems (int rtti=QwtPlotItem::Rtti_PlotItem, bool autoDelete=true)

## Protected Member Functions
void | insertItem (QwtPlotItem *)
void | removeItem (QwtPlotItem *)

## Detailed Description

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.

See Also
  QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z()

## Constructor & Destructor Documentation

QwtPlotDict::QwtPlotDict | ( |  | ) |
| explicit

Constructor

Auto deletion is enabled.

See Also
  setAutoDelete(), QwtPlotItem::attach()

QwtPlotDict::~QwtPlotDict | ( |  | ) |
| virtual

Destructor

If autoDelete() is on, all attached items will be deleted

See Also
  setAutoDelete(), autoDelete(), QwtPlotItem::attach()

## Member Function Documentation

bool QwtPlotDict::autoDelete | ( |  | ) | const

Returns
  true if auto deletion is enabled

See Also
  setAutoDelete(), insertItem()

void QwtPlotDict::detachItems | ( | int | rtti = `QwtPlotItem::Rtti_PlotItem`,
|  | bool | autoDelete = `true`
| ) |  |

Detach items from the dictionary

Parameters

  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

void QwtPlotDict::insertItem | ( | QwtPlotItem * | item | ) |
| protected

Insert a plot item

Parameters

  item | PlotItem

See Also
  removeItem()

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.

Returns
  List of all attached plot items.

QwtPlotItemList QwtPlotDict::itemList | ( | int | rtti | ) | const

Returns
  List of all attached plot items of a specific type.

Parameters

  rtti | See QwtPlotItem::RttiValues

See Also
  QwtPlotItem::rtti()

void QwtPlotDict::removeItem | ( | QwtPlotItem * | item | ) |
| protected

Remove a plot item

Parameters

  item | PlotItem

See Also
  insertItem()

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.

See Also
  autoDelete(), insertItem()