Signals | Public Member Functions

vtkQtChartLegendModel Class Reference

The vtkQtChartLegendModel class stores the data for a chart legend. More...

#include <vtkQtChartLegendModel.h>

List of all members.

Signals

void entryInserted (int index)
 Emitted when a new entry is added.
void removingEntry (int index)
 Emitted before an entry is removed.
void entryRemoved (int index)
 Emitted after an entry is removed.
void entriesReset ()
 Emitted when the legend entries are reset.
void iconChanged (int index)
 Emitted when the icon for an entry has changed.
void textChanged (int index)
 Emitted when the text for an entry has changed.

Public Member Functions

 vtkQtChartLegendModel (QObject *parent=0)
 Creates a chart legend model.
virtual ~vtkQtChartLegendModel ()
int addEntry (const QPixmap &icon, const QString &text)
 Adds an entry to the chart legend.
int insertEntry (int index, const QPixmap &icon, const QString &text)
 Inserts an entry into the chart legend.
void removeEntry (int index)
 Removes an entry from the chart legend.
void removeAllEntries ()
 Removes all the entries from the legend.
void startModifyingData ()
 Blocks the model modification signals.
void finishModifyingData ()
 Unblocks the model modification signals.
int getNumberOfEntries () const
 Gets the number of entries in the legend.
int getIndexForId (unsigned int id) const
 Gets the index for the given id.
QPixmap getIcon (int index) const
 Gets the icon for the given index.
void setIcon (int index, const QPixmap &icon)
 Sets the icon for the given index.
QString getText (int index) const
 Gets the text for the given index.
void setText (int index, const QString &text)
 Sets the text for the given index.

Detailed Description

The vtkQtChartLegendModel class stores the data for a chart legend.

Definition at line 41 of file vtkQtChartLegendModel.h.


Constructor & Destructor Documentation

vtkQtChartLegendModel::vtkQtChartLegendModel ( QObject *  parent = 0 )

Creates a chart legend model.

Parameters:
parentThe parent object.
virtual vtkQtChartLegendModel::~vtkQtChartLegendModel (  ) [virtual]

Member Function Documentation

int vtkQtChartLegendModel::addEntry ( const QPixmap &  icon,
const QString &  text 
)

Adds an entry to the chart legend.

Parameters:
iconThe series identifying image.
textThe series label.
Returns:
The id for the inserted entry or zero for failure.
void vtkQtChartLegendModel::entriesReset (  ) [signal]

Emitted when the legend entries are reset.

void vtkQtChartLegendModel::entryInserted ( int  index ) [signal]

Emitted when a new entry is added.

Parameters:
indexWhere the entry was added.
void vtkQtChartLegendModel::entryRemoved ( int  index ) [signal]

Emitted after an entry is removed.

Parameters:
indexThe index being removed.
void vtkQtChartLegendModel::finishModifyingData (  )

Unblocks the model modification signals.

The entriesReset signal is emitted to synchronize the view.

See also:
vtkQtChartLegendModel::startModifyingData()
QPixmap vtkQtChartLegendModel::getIcon ( int  index ) const

Gets the icon for the given index.

Parameters:
indexThe index of the entry.
Returns:
The icon for the given index or a null pixmap if the index is out of bounds.
int vtkQtChartLegendModel::getIndexForId ( unsigned int  id ) const

Gets the index for the given id.

Parameters:
idThe entry identifier.
Returns:
The index for the entry that matches the id or -1 if there is no matching entry.
int vtkQtChartLegendModel::getNumberOfEntries (  ) const

Gets the number of entries in the legend.

Returns:
The number of entries in the legend.
QString vtkQtChartLegendModel::getText ( int  index ) const

Gets the text for the given index.

Parameters:
indexThe index of the entry.
Returns:
The text for the given index or a null string if the index is out of bounds.
void vtkQtChartLegendModel::iconChanged ( int  index ) [signal]

Emitted when the icon for an entry has changed.

Parameters:
indexThe index of the entry that changed.
int vtkQtChartLegendModel::insertEntry ( int  index,
const QPixmap &  icon,
const QString &  text 
)

Inserts an entry into the chart legend.

Parameters:
indexWhere to place the new entry.
iconThe series identifying image.
textThe series label.
Returns:
The id for the inserted entry or zero for failure.
void vtkQtChartLegendModel::removeAllEntries (  )

Removes all the entries from the legend.

void vtkQtChartLegendModel::removeEntry ( int  index )

Removes an entry from the chart legend.

Parameters:
indexThe index of the entry to remove.
void vtkQtChartLegendModel::removingEntry ( int  index ) [signal]

Emitted before an entry is removed.

Parameters:
indexThe index being removed.
void vtkQtChartLegendModel::setIcon ( int  index,
const QPixmap &  icon 
)

Sets the icon for the given index.

Parameters:
indexThe index of the entry.
iconThe new series icon.
void vtkQtChartLegendModel::setText ( int  index,
const QString &  text 
)

Sets the text for the given index.

Parameters:
indexThe index of the entry.
textThe new series label.
void vtkQtChartLegendModel::startModifyingData (  )

Blocks the model modification signals.

This method should be called before making multiple changes to the model. It will prevent the view from updating before the changes are complete. Once all the changes are made, the finishModifyingData method should be called to notify the view of the changes.

See also:
vtkQtChartLegendModel::finishModifyingData()
void vtkQtChartLegendModel::textChanged ( int  index ) [signal]

Emitted when the text for an entry has changed.

Parameters:
indexThe index of the entry that changed.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines