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

QwtLegendItem Class Reference

Inheritance diagram for QwtLegendItem:

Inheritance graph
[legend]
Collaboration diagram for QwtLegendItem:

Collaboration graph
[legend]
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 QwtText &, QWidget *parent=0)
virtual ~QwtLegendItem ()
virtual void setText (const QwtText &)
void setItemMode (QwtLegend::LegendItemMode)
QwtLegend::LegendItemMode itemMode () 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 void paintEvent (QPaintEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void keyReleaseEvent (QKeyEvent *)
virtual void drawText (QPainter *, const QRect &)


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

Definition at line 69 of file qwt_legend_item.cpp.

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

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

Definition at line 82 of file qwt_legend_item.cpp.


Member Function Documentation

const QPen & QwtLegendItem::curvePen  )  const
 

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

Definition at line 211 of file qwt_legend_item.cpp.

Referenced by QwtPlotPrintFilter::apply(), 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 221 of file qwt_legend_item.cpp.

References QwtPainter::drawLine(), QwtPainter::metricsMap(), and QwtMetricsMap::screenToLayout().

Referenced by drawItem(), and paintEvent().

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 277 of file qwt_legend_item.cpp.

References QwtText::draw(), drawIdentifier(), QwtTextLabel::margin(), QwtPainter::metricsMap(), QwtMetricsMap::screenToLayoutX(), and QwtTextLabel::text().

Referenced by QwtPlot::printLegendItem().

void QwtLegendItem::drawText QPainter *  ,
const QRect & 
[protected, virtual]
 

Redraw the text.

Reimplemented from QwtTextLabel.

Definition at line 456 of file qwt_legend_item.cpp.

References QwtTextLabel::drawText().

int QwtLegendItem::identifierMode  )  const
 

Or'd values of IdentifierMode.

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

Definition at line 162 of file qwt_legend_item.cpp.

void QwtLegendItem::paintEvent QPaintEvent *   )  [protected, virtual]
 

Qt paint event.

Reimplemented from QwtTextLabel.

Definition at line 299 of file qwt_legend_item.cpp.

References QwtTextLabel::drawContents(), and drawIdentifier().

void QwtLegendItem::setCurvePen const QPen &  pen  ) 
 

Set curve pen.

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

Definition at line 198 of file qwt_legend_item.cpp.

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

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 149 of file qwt_legend_item.cpp.

Referenced by QwtPlotCurve::updateLegend().

void QwtLegendItem::setSymbol const QwtSymbol symbol  ) 
 

Set curve symbol.

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

Definition at line 173 of file qwt_legend_item.cpp.

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

void QwtLegendItem::setText const QwtText text  )  [virtual]
 

Change the label“s text

Parameters:
text New text

Reimplemented from QwtTextLabel.

Definition at line 108 of file qwt_legend_item.cpp.

References QwtText::setFlags(), and QwtTextLabel::setText().

Referenced by QwtPlotCurve::updateLegend().

QSize QwtLegendItem::sizeHint  )  const [virtual]
 

Return label's margin in pixels.

Reimplemented from QwtTextLabel.

Definition at line 447 of file qwt_legend_item.cpp.

References QwtTextLabel::sizeHint().

const QwtSymbol & QwtLegendItem::symbol  )  const
 

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

Definition at line 186 of file qwt_legend_item.cpp.

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


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