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

QwtLegendItem Class Reference

List of all members.

Detailed Description

A legend label.

QwtLegendItem represents a curve on a legend. It displays an curve identifier with an explaining text. The identifier might be a combination of curve symbol and line. In readonly mode it behaves like a label, otherwise like an unstylish push button.

See also:
QwtLegend, QwtCurve

Definition at line 35 of file qwt_legend_item.h.

Public Types

enum  IdentifierMode {
  NoIdentifier = 0,
  ShowLine = 1,
  ShowSymbol = 2,
  ShowText = 4
}

Public Slots

void setChecked (bool on)

Signals

void clicked ()
void pressed ()
void released ()
void checked (bool)

Public Member Functions

 QwtLegendItem (QWidget *parent=0)
 QwtLegendItem (const QwtSymbol &, const QPen &, const QString &, QWidget *parent=0)
void setItemMode (QwtLegend::LegendItemMode)
QwtLegend::LegendItemMode itemMode () const
virtual void setTitle (const QString &)
virtual QString title () const
void setIdentifierMode (int)
int identifierMode () const
void setSymbol (const QwtSymbol &)
const QwtSymbolsymbol () const
void setCurvePen (const QPen &)
const QPen & curvePen () const
virtual void drawIdentifier (QPainter *, const QRect &) const
virtual void drawItem (QPainter *p, const QRect &) const
virtual QSize sizeHint () const
bool isChecked () const

Protected Member Functions

void setDown (bool)
bool isDown () const
virtual QwtTexttitleText () const
virtual void paintEvent (QPaintEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void keyReleaseEvent (QKeyEvent *)


Member Enumeration Documentation

enum QwtLegendItem::IdentifierMode
 

Identifier mode.

Default is ShowLine | ShowText

See also:
QwtLegendItem::identifierMode, QwtLegendItem::setIdentifierMode

Definition at line 47 of file qwt_legend_item.h.


Constructor & Destructor Documentation

QwtLegendItem::QwtLegendItem QWidget *  parent = 0  )  [explicit]
 

Parameters:
parent Parent widget
name Widget name

Definition at line 71 of file qwt_legend_item.cpp.

QwtLegendItem::QwtLegendItem const QwtSymbol symbol,
const QPen &  curvePen,
const QString &  text,
QWidget *  parent = 0
[explicit]
 

Parameters:
symbol Curve symbol
curvePen Curve pen
text Label text
parent Parent widget
name Widget name

Definition at line 86 of file qwt_legend_item.cpp.

References curvePen(), and symbol().


Member Function Documentation

const QPen & QwtLegendItem::curvePen  )  const
 

Returns:
The curve pen.
See also:
QwtLegendItem::setCurvePen()

Definition at line 238 of file qwt_legend_item.cpp.

Referenced by QwtPlotPrintFilter::apply(), QwtLegendItem(), and QwtPlotPrintFilter::reset().

void QwtLegendItem::drawIdentifier QPainter *  painter,
const QRect &  rect
const [virtual]
 

Paint the identifier to a given rect.

Parameters:
painter Painter
rect Rect where to paint

Definition at line 248 of file qwt_legend_item.cpp.

References QwtSymbol::draw(), QwtPainter::drawLine(), QwtPainter::metricsMap(), QwtSymbol::setBrush(), QwtSymbol::setPen(), and QwtSymbol::setSize().

Referenced by drawItem().

void QwtLegendItem::drawItem QPainter *  painter,
const QRect &  rect
const [virtual]
 

Draw the legend item to a given rect.

Parameters:
painter Painter
rect Rect where to paint the button

Definition at line 304 of file qwt_legend_item.cpp.

References QwtText::draw(), drawIdentifier(), QwtPainter::metricsMap(), and titleText().

Referenced by QwtPlot::printLegendItem().

int QwtLegendItem::identifierMode  )  const
 

Or'd values of IdentifierMode.

See also:
QwtLegendItem::setIdentifierMode(), QwtLegendItem::IdentifierMode

Definition at line 189 of file qwt_legend_item.cpp.

void QwtLegendItem::setCurvePen const QPen &  pen  ) 
 

Set curve pen.

Parameters:
pen Curve pen
See also:
QwtLegendItem::curvePen()

Definition at line 225 of file qwt_legend_item.cpp.

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

void QwtLegendItem::setIdentifierMode int  mode  ) 
 

Set identifier mode. Default is ShowLine | ShowText.

Parameters:
mode Or'd values of IdentifierMode
See also:
QwtLegendItem::identifierMode()

Definition at line 176 of file qwt_legend_item.cpp.

void QwtLegendItem::setSymbol const QwtSymbol symbol  ) 
 

Set curve symbol.

Parameters:
symbol Symbol
See also:
QwtLegendItem::symbol()

Definition at line 200 of file qwt_legend_item.cpp.

References symbol().

Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().

void QwtLegendItem::setTitle const QString &  title  )  [virtual]
 

Set the title of the label

Parameters:
title New title
See also:
QwtLegendItem::title

Definition at line 145 of file qwt_legend_item.cpp.

References title().

const QwtSymbol & QwtLegendItem::symbol  )  const
 

Returns:
The curve symbol.
See also:
QwtLegendItem::setSymbol()

Definition at line 213 of file qwt_legend_item.cpp.

Referenced by QwtPlotPrintFilter::apply(), QwtLegendItem(), QwtPlotPrintFilter::reset(), and setSymbol().

QString QwtLegendItem::title  )  const [virtual]
 

Returns:
The label title
See also:
QwtLegendItem::setTitle.

Definition at line 154 of file qwt_legend_item.cpp.

Referenced by setTitle().

QwtText * QwtLegendItem::titleText  )  const [protected, virtual]
 

Returns:
The item title
See also:
QwtLegendItem::setTitle.

Definition at line 163 of file qwt_legend_item.cpp.

References QwtText::makeText().

Referenced by drawItem().


Generated on Wed Aug 31 23:03:13 2005 for Qwt User's Guide by  doxygen 1.4.1