Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

QwtLegend Class Reference

List of all members.

Detailed Description

The legend widget.

The QwtLegend widget is a tabular arrangement of legend items. Legend items might be any type of widget, but in general they will be a QwtLegendButton.

See also:
QwtLegendButton, QwtPlot


Public Types

enum  LegendDisplayPolicy {
  None = 0,
  Fixed = 1,
  Auto = 2
}

Public Member Functions

 QwtLegend (QWidget *parent=0, const char *name=0)
void setReadOnly (bool readOnly)
bool isReadOnly () const
void setDisplayPolicy (LegendDisplayPolicy policy, int mode=-1)
LegendDisplayPolicy displayPolicy () const
int identifierMode () const
QWidget * contentsWidget ()
const QWidget * contentsWidget () const
void insertItem (QWidget *, long key)
QWidget * findItem (long key)
const QWidget * findItem (long key) const
QWidget * takeItem (long key)
virtual QWidgetIntDictIt itemIterator () const
long key (const QWidget *) const
void clear ()
bool isEmpty () const
uint itemCount () const
virtual bool eventFilter (QObject *, QEvent *)
virtual QSize sizeHint () const
virtual int heightForWidth (int w) const

Protected Member Functions

virtual void viewportResizeEvent (QResizeEvent *)
virtual void layoutContents ()


Member Enumeration Documentation

enum QwtLegend::LegendDisplayPolicy
 

Display policy.

  • None
    the client code is responsible how to display of each legend item. The Qwt library will not interfere.

  • Fixed
    all legend items are displayed with the QwtLegendItem::IdentifierMode to be passed in 'mode'.

  • Auto
    each legend item is displayed with a mode that is a bitwise or of
    • QwtLegendItem::ShowLine (if its curve is drawn with a line) and
    • QwtLegendItem::ShowSymbol (if its curve is drawn with symbols) and
    • QwtLegendItem::ShowText (if the has a title).

Default is LegendDisplayPolicy::Auto.

See also:
QwtLegend::setDisplayPolicy, QwtLegend::displayPolicy, QwtLegendItem::IdentifierMode


Constructor & Destructor Documentation

QwtLegend::QwtLegend QWidget *  parent = 0,
const char *  name = 0
 

Parameters:
parent Parent widget
name Widget name


Member Function Documentation

void QwtLegend::clear  ) 
 

Remove all items.

const QWidget * QwtLegend::contentsWidget  )  const
 

The contents widget is the only child of the viewport() and the parent widget of all legend items.

QWidget * QwtLegend::contentsWidget  ) 
 

The contents widget is the only child of the viewport() and the parent widget of all legend items.

QwtLegend::LegendDisplayPolicy QwtLegend::displayPolicy  )  const
 

Return the legend display policy. Default is LegendDisplayPolicy::Auto.

See also:
QwtLegend::setDisplayPolicy, QwtLegend::LegendDisplayPolicy

const QWidget * QwtLegend::findItem long  key  )  const
 

Find the item for a given key.

QWidget * QwtLegend::findItem long  key  ) 
 

Find the item for a given key.

int QwtLegend::heightForWidth int  w  )  const [virtual]
 

Returns:
The preferred height, for the width w.

int QwtLegend::identifierMode  )  const
 

Return the IdentifierMode to be used in combination with LegendDisplayPolicy::Fixed.

Default is ShowLine | ShowSymbol | ShowText.

void QwtLegend::insertItem QWidget *  item,
long  key
 

Insert a new item for a specific key.

Parameters:
item New legend item
key Unique key. Key must be >= 0.
Note:
The parent of item will be changed to QwtLegend::contentsWidget()

In case of key < 0, nothing will be inserted.

bool QwtLegend::isEmpty  )  const
 

Return TRUE, if there are no legend items.

uint QwtLegend::itemCount  )  const
 

Return the number of legend items.

QWidgetIntDictIt QwtLegend::itemIterator  )  const [virtual]
 

Return an item iterator.

long QwtLegend::key const QWidget *  item  )  const
 

Return the key of an legend item.

Parameters:
item Legend item
Returns:
key of the item, or -1 if the item can't be found.

void QwtLegend::layoutContents  )  [protected, virtual]
 

Adjust contents widget and item layout to the size of the viewport().

void QwtLegend::setDisplayPolicy LegendDisplayPolicy  policy,
int  mode = -1
 

Set the legend display policy to:

Parameters:
policy Legend display policy
mode Identifier mode (or'd ShowLine, ShowSymbol, ShowText)
See also:
QwtLegend::displayPolicy, QwtLegend::LegendDisplayPolicy

QSize QwtLegend::sizeHint  )  const [virtual]
 

Return a size hint.

QWidget * QwtLegend::takeItem long  key  ) 
 

Find the item for a given key and remove it from the item list.


Generated on Tue Nov 25 21:15:07 2003 for Qwt User's Guide by doxygen 1.3.4