Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 QwtLegendItem.

See also:
QwtLegendItem, QwtPlot

Definition at line 36 of file qwt_legend.h.

Public Types

enum  LegendDisplayPolicy {
  None = 0,
  Fixed = 1,
  Auto = 2
}
enum  LegendItemMode {
  ReadOnlyItem,
  ClickableItem,
  CheckableItem
}

Public Member Functions

 QwtLegend (QWidget *parent=NULL)
virtual ~QwtLegend ()
void setDisplayPolicy (LegendDisplayPolicy policy, int mode=-1)
LegendDisplayPolicy displayPolicy () const
void setItemMode (LegendItemMode)
LegendItemMode itemMode () const
int identifierMode () const
QWidget * contentsWidget ()
const QWidget * contentsWidget () const
void insert (const QwtPlotItem *, QWidget *)
void remove (const QwtPlotItem *)
QWidget * find (const QwtPlotItem *) const
QwtPlotItemfind (const QWidget *) const
virtual QValueList< QWidget * > legendItems () const
void clear ()
bool isEmpty () const
uint itemCount () const
virtual bool eventFilter (QObject *, QEvent *)
virtual QSize sizeHint () const
virtual int heightForWidth (int w) const
QScrollBar * horizontalScrollBar () const
QScrollBar * verticalScrollBar () const

Protected Member Functions

virtual void resizeEvent (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.

  • 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

Definition at line 62 of file qwt_legend.h.


Constructor & Destructor Documentation

QwtLegend::QwtLegend QWidget *  parent = NULL  )  [explicit]
 

Parameters:
parent Parent widget

Definition at line 237 of file qwt_legend.cpp.


Member Function Documentation

void QwtLegend::clear  ) 
 

Remove all items.

Definition at line 435 of file qwt_legend.cpp.

const QWidget * QwtLegend::contentsWidget  )  const
 

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

Definition at line 353 of file qwt_legend.cpp.

QWidget * QwtLegend::contentsWidget  ) 
 

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

Definition at line 333 of file qwt_legend.cpp.

Referenced by insert(), and QwtPlot::printLegend().

QwtLegend::LegendDisplayPolicy QwtLegend::displayPolicy  )  const
 

Returns:
the legend display policy. Default is LegendDisplayPolicy::Auto.
See also:
QwtLegend::setDisplayPolicy, QwtLegend::LegendDisplayPolicy

Definition at line 302 of file qwt_legend.cpp.

Referenced by QwtPlotCurve::updateLegend().

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

Returns:
The preferred height, for the width w.

Definition at line 462 of file qwt_legend.cpp.

Referenced by QwtPlotLayout::minimumSizeHint().

int QwtLegend::identifierMode  )  const
 

Returns:
the IdentifierMode to be used in combination with LegendDisplayPolicy::Fixed.
Default is ShowLine | ShowSymbol | ShowText.

Definition at line 324 of file qwt_legend.cpp.

Referenced by QwtPlotCurve::updateLegend().

void QwtLegend::insert const QwtPlotItem plotItem,
QWidget *  legendItem
 

Insert a new item for a plot item

Parameters:
plotItem Plot item
legendItem New legend item
Note:
The parent of item will be changed to QwtLegend::contentsWidget()

Definition at line 364 of file qwt_legend.cpp.

References contentsWidget(), and layoutContents().

Referenced by QwtPlotItem::updateLegend().

bool QwtLegend::isEmpty  )  const
 

Return true, if there are no legend items.

Definition at line 558 of file qwt_legend.cpp.

Referenced by QwtPlotLayout::activate(), QwtPlotLayout::minimumSizeHint(), and QwtPlot::print().

uint QwtLegend::itemCount  )  const
 

Return the number of legend items.

Definition at line 564 of file qwt_legend.cpp.

void QwtLegend::layoutContents  )  [protected, virtual]
 

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

Definition at line 487 of file qwt_legend.cpp.

References QwtDynGridLayout::heightForWidth(), QwtDynGridLayout::maxItemWidth(), and qwtMax.

Referenced by eventFilter(), and insert().

void QwtLegend::remove const QwtPlotItem  ) 
 

Find the corresponding item for a plotItem and remove it from the item list.

Definition at line 427 of file qwt_legend.cpp.

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

Definition at line 274 of file qwt_legend.cpp.

References QwtPlotItem::updateLegend().

QSize QwtLegend::sizeHint  )  const [virtual]
 

Return a size hint.

Definition at line 451 of file qwt_legend.cpp.

Referenced by QwtPlotLayout::minimumSizeHint().


Generated on Mon Jan 30 22:17:05 2006 for Qwt User's Guide by  doxygen 1.4.4