vtkQtChartLegend Class Reference

#include <vtkQtChartLegend.h>

Collaboration diagram for vtkQtChartLegend:

Collaboration graph
[legend]

List of all members.


Detailed Description

The vtkQtChartLegend class displays a chart legend.

A vtkQtChartLegendModel is used to describe the entries. Each entry can have an icon and a label. The icon is used to visually identify the series on the chart. For a line chart series, the image should be drawn in the same color and line style.

Definition at line 47 of file vtkQtChartLegend.h.


Public Types

enum  LegendLocation { Left = 0, Top, Right, Bottom }
enum  ItemFlow { LeftToRight = 0, TopToBottom }

Public Slots

void reset ()
 Resets the chart legend.
void setOffset (int offset)
 Sets the panning offset.

Signals

void locationChanged ()
 Emitted when the legend location is changed.

Public Member Functions

 vtkQtChartLegend (QWidget *parent=0)
 Creates a chart legend instance.
virtual ~vtkQtChartLegend ()
int getOffset () const
 Gets the panning offset.
virtual QSize sizeHint () const
 Gets the preferred size of the chart legend.
void drawLegend (QPainter &painter)
 Draws the legend using the given painter.
Setup Methods
vtkQtChartLegendModelgetModel () const
 Gets the legend model.
LegendLocation getLocation () const
 Gets the legend location.
void setLocation (LegendLocation location)
 Sets the legend location.
ItemFlow getFlow () const
 Gets the legend item flow.
void setFlow (ItemFlow flow)
 Sets the legend item flow.

Protected Slots

void insertEntry (int index)
 Inserts a new entry in the legend.
void startEntryRemoval (int index)
 Starts the entry removal process.
void finishEntryRemoval (int index)
 Finishes the entry removal process.
void updateEntryText (int index)
 Updates the text for the given entry.
void updateEntryVisible (int index)
 Updates the visibility for the given entry.

Protected Member Functions

virtual bool event (QEvent *e)
 Updates the layout when the font changes.
virtual void paintEvent (QPaintEvent *e)
 Draws the chart title.
virtual void resizeEvent (QResizeEvent *e)
 Updates the maximum offset when the size changes.
virtual void mousePressEvent (QMouseEvent *e)
 Used for panning the contents of the legend.
virtual void mouseMoveEvent (QMouseEvent *e)
 Used for panning the contents of the legend.
virtual void mouseReleaseEvent (QMouseEvent *e)
 Used for panning the contents of the legend.

Member Enumeration Documentation

Enumerator:
Left  Place the legend on the left of the chart.
Top  Place the legend on the top of the chart.
Right  Place the legend on the right of the chart.
Bottom  Place the legend on the bottom of the chart.

Definition at line 52 of file vtkQtChartLegend.h.

Enumerator:
LeftToRight  Items are arranged left to right.
TopToBottom  Items are arranged top to bottom.

Definition at line 60 of file vtkQtChartLegend.h.


Constructor & Destructor Documentation

vtkQtChartLegend::vtkQtChartLegend ( QWidget *  parent = 0  ) 

Creates a chart legend instance.

Parameters:
parent The parent widget.

virtual vtkQtChartLegend::~vtkQtChartLegend (  )  [virtual]


Member Function Documentation

vtkQtChartLegendModel* vtkQtChartLegend::getModel (  )  const [inline]

Gets the legend model.

Returns:
A pointer to the legend model.

Definition at line 79 of file vtkQtChartLegend.h.

LegendLocation vtkQtChartLegend::getLocation (  )  const [inline]

Gets the legend location.

Returns:
The legend location.

Definition at line 85 of file vtkQtChartLegend.h.

void vtkQtChartLegend::setLocation ( LegendLocation  location  ) 

Sets the legend location.

The chart uses the location to place the legend in the appropriate place. The combination of location and flow determine how the legend looks.

Parameters:
location The new legend location.

ItemFlow vtkQtChartLegend::getFlow (  )  const [inline]

Gets the legend item flow.

Returns:
The legend item flow.

Definition at line 101 of file vtkQtChartLegend.h.

void vtkQtChartLegend::setFlow ( ItemFlow  flow  ) 

Sets the legend item flow.

The flow is used to determine the layout direction of the legend entries. Depending on the location, the same flow type can look different.

Parameters:
flow The new item flow.

int vtkQtChartLegend::getOffset (  )  const

Gets the panning offset.

Returns:
The current panning offset.

virtual QSize vtkQtChartLegend::sizeHint (  )  const [inline, virtual]

Gets the preferred size of the chart legend.

Returns:
The preferred size of the chart legend.

Definition at line 124 of file vtkQtChartLegend.h.

void vtkQtChartLegend::drawLegend ( QPainter &  painter  ) 

Draws the legend using the given painter.

Parameters:
painter The painter to use.

void vtkQtChartLegend::locationChanged (  )  [signal]

Emitted when the legend location is changed.

void vtkQtChartLegend::reset (  )  [slot]

Resets the chart legend.

void vtkQtChartLegend::setOffset ( int  offset  )  [slot]

Sets the panning offset.

The offset is applied to the x or y axis depending on the legend's location.

Parameters:
offset The new panning offset.

void vtkQtChartLegend::insertEntry ( int  index  )  [protected, slot]

Inserts a new entry in the legend.

Parameters:
index Where to insert the entry.

void vtkQtChartLegend::startEntryRemoval ( int  index  )  [protected, slot]

Starts the entry removal process.

Parameters:
index The entry being removed.

void vtkQtChartLegend::finishEntryRemoval ( int  index  )  [protected, slot]

Finishes the entry removal process.

Parameters:
index The entry that was removed.

void vtkQtChartLegend::updateEntryText ( int  index  )  [protected, slot]

Updates the text for the given entry.

Parameters:
index The index of the modified entry.

void vtkQtChartLegend::updateEntryVisible ( int  index  )  [protected, slot]

Updates the visibility for the given entry.

Parameters:
index The index of the modified entry.

virtual bool vtkQtChartLegend::event ( QEvent *  e  )  [protected, virtual]

Updates the layout when the font changes.

Parameters:
e Event specific information.
Returns:
True if the event was handled.

virtual void vtkQtChartLegend::paintEvent ( QPaintEvent *  e  )  [protected, virtual]

Draws the chart title.

Parameters:
e Event specific information.

virtual void vtkQtChartLegend::resizeEvent ( QResizeEvent *  e  )  [protected, virtual]

Updates the maximum offset when the size changes.

Parameters:
e Event specific information.

virtual void vtkQtChartLegend::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Used for panning the contents of the legend.

The widget cursor is set for panning.

Parameters:
e Event specific information.

virtual void vtkQtChartLegend::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

Used for panning the contents of the legend.

The conents are moved by changing the offset.

Parameters:
e Event specific information.

virtual void vtkQtChartLegend::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Used for panning the contents of the legend.

The widget cursor is reset after panning.

Parameters:
e Event specific information.


The documentation for this class was generated from the following file:

Generated on Wed Aug 24 11:59:42 2011 for VTK by  doxygen 1.5.6