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

QwtLegendButton Class Reference

A legend button. More...

#include <qwt_legend.h>

List of all members.

Public Types

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

Public Member Functions

 QwtLegendButton (QWidget *parent=0, const char *name=0)
 QwtLegendButton (const QwtSymbol &, const QPen &, const QString &, QWidget *parent=0, const char *name=0)
int identifierMode () const
const QwtSymbolsymbol () const
const QPen & curvePen () const
void setIdentifierMode (int)
void setSymbol (const QwtSymbol &)
void setCurvePen (const QPen &)
virtual void drawContents (QPainter *p, const QRect &) const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const

Protected Member Functions

virtual void updateIconset ()
virtual void drawButtonLabel (QPainter *)
virtual void drawIdentifier (QPainter *, const QRect &) const

Private Attributes

int d_identifierMode
QwtSymbol d_symbol
QPen d_curvePen


Detailed Description

A legend button.

QwtLegendButton 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.

See also:
QwtLegend, QwtCurve

Definition at line 40 of file qwt_legend.h.


Member Enumeration Documentation

enum QwtLegendButton::IdentifierMode
 

Enumeration values:
NoIdentifier 
ShowLine 
ShowSymbol 
ShowText 

Definition at line 46 of file qwt_legend.h.


Constructor & Destructor Documentation

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

Parameters:
parent Parent widget
name Widget name

Definition at line 46 of file qwt_legend.cpp.

References updateIconset().

QwtLegendButton::QwtLegendButton const QwtSymbol symbol,
const QPen &  pen,
const QString &  text,
QWidget *  parent = 0,
const char *  name = 0
 

Parameters:
symbol Curve symbol
pen Curve pen
text Button text
parent Parent widget
name Widget name

Definition at line 29 of file qwt_legend.cpp.

References updateIconset().


Member Function Documentation

const QPen& QwtLegendButton::curvePen  )  const [inline]
 

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

Definition at line 75 of file qwt_legend.h.

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

void QwtLegendButton::drawButtonLabel QPainter *  painter  )  [protected, virtual]
 

Draws the button label. Does some dirty tricks to draw only 90% style conform.

Parameters:
painter Painter
See also:
QwtLegendButton::draw()

Definition at line 249 of file qwt_legend.cpp.

void QwtLegendButton::drawContents QPainter *  painter,
const QRect &  rect
const [virtual]
 

Draw the legend button contents.

Parameters:
painter Painter
rect Rect where to paint the button
See also:
drawButtonLabel
Note:
drawContents is intended for printing

Definition at line 164 of file qwt_legend.cpp.

References drawIdentifier(), QwtPainter::drawText(), and IdentifierWidth.

Referenced by QwtPlot::printLegendItem().

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

Paint the identifier to a given rect.

Parameters:
painter Painter
rect Rect where to paint

Definition at line 126 of file qwt_legend.cpp.

References d_curvePen, d_identifierMode, d_symbol, QwtSymbol::draw(), QwtSymbol::None, QwtPainter::scale(), ShowLine, ShowSymbol, QwtSymbol::size(), and QwtSymbol::style().

Referenced by drawContents(), and updateIconset().

int QwtLegendButton::identifierMode  )  const [inline]
 

Or'd values of IdentifierMode. The default is QwtLegendButton::ShowLine | QwtLegendButton::ShowText.

See also:
QwtLegendButton::setIdentifierMode()

Definition at line 63 of file qwt_legend.h.

QSize QwtLegendButton::minimumSizeHint  )  const [virtual]
 

Minimum size hint

See also:
sizeHint()

Definition at line 290 of file qwt_legend.cpp.

Referenced by sizeHint().

void QwtLegendButton::setCurvePen const QPen &  pen  ) 
 

Set curve pen.

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

Definition at line 93 of file qwt_legend.cpp.

References d_curvePen, and updateIconset().

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

void QwtLegendButton::setIdentifierMode int  mode  ) 
 

Set identifier mode. Default is QwtLegendButton::ShowLine | QwtLegendButton::ShowText.

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

Definition at line 63 of file qwt_legend.cpp.

References d_identifierMode, and updateIconset().

Referenced by QwtPlot::updateLegendItem().

void QwtLegendButton::setSymbol const QwtSymbol symbol  ) 
 

Set curve symbol.

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

Definition at line 78 of file qwt_legend.cpp.

References d_symbol, and updateIconset().

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

QSize QwtLegendButton::sizeHint  )  const [virtual]
 

Returns:
Minimum size hint
See also:
minimumSizeHint()

Definition at line 281 of file qwt_legend.cpp.

References minimumSizeHint().

const QwtSymbol& QwtLegendButton::symbol  )  const [inline]
 

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

Definition at line 69 of file qwt_legend.h.

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

void QwtLegendButton::updateIconset  )  [protected, virtual]
 

Update the iconset according to the current identifier properties

Definition at line 105 of file qwt_legend.cpp.

References drawIdentifier(), and IdentifierWidth.

Referenced by QwtLegendButton(), setCurvePen(), setIdentifierMode(), and setSymbol().


Member Data Documentation

QPen QwtLegendButton::d_curvePen [private]
 

Definition at line 94 of file qwt_legend.h.

Referenced by drawIdentifier(), and setCurvePen().

int QwtLegendButton::d_identifierMode [private]
 

Definition at line 92 of file qwt_legend.h.

Referenced by drawIdentifier(), and setIdentifierMode().

QwtSymbol QwtLegendButton::d_symbol [private]
 

Definition at line 93 of file qwt_legend.h.

Referenced by drawIdentifier(), and setSymbol().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 14:11:48 2003 for Qwt Developer's Guide by doxygen 1.3.2