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

QwtSymbol Class Reference

A class for drawing symbols. More...

#include <qwt_symbol.h>

List of all members.

Public Types

enum  Style {
  None, Ellipse, Rect, Diamond,
  Triangle, DTriangle, UTriangle, LTriangle,
  RTriangle, Cross, XCross, StyleCnt
}

Public Member Functions

 QwtSymbol ()
 QwtSymbol (Style st, const QBrush &bd, const QPen &pn, const QSize &s)
virtual ~QwtSymbol ()
bool operator!= (const QwtSymbol &) const
bool operator== (const QwtSymbol &) const
void setSize (const QSize &s)
void setSize (int a, int b=-1)
void setBrush (const QBrush &b)
void setPen (const QPen &p)
void setStyle (Style s)
const QBrush & brush () const
const QPen & pen () const
const QSize & size () const
Style style () const
void draw (QPainter *p, const QPoint &pt) const
void draw (QPainter *p, int x, int y) const
virtual void draw (QPainter *p, const QRect &r) const

Protected Attributes

QBrush d_brush
QPen d_pen
QSize d_size
Style d_style


Detailed Description

A class for drawing symbols.

Definition at line 22 of file qwt_symbol.h.


Member Enumeration Documentation

enum QwtSymbol::Style
 

Style

See also:
QwtSymbol::setStyle, QwtSymbol::style
Enumeration values:
None 
Ellipse 
Rect 
Diamond 
Triangle 
DTriangle 
UTriangle 
LTriangle 
RTriangle 
Cross 
XCross 
StyleCnt 

Definition at line 29 of file qwt_symbol.h.


Constructor & Destructor Documentation

QwtSymbol::QwtSymbol  ) 
 

Default Constructor

The symbol is constructed with gray interior, black outline with zero width, no size and style 'None'.

Definition at line 22 of file qwt_symbol.cpp.

QwtSymbol::QwtSymbol QwtSymbol::Style  style,
const QBrush &  brush,
const QPen &  pen,
const QSize &  size
 

Constructor.

Parameters:
style Symbol Style
brush brush to fill the interior
pen outline pen
size size

Definition at line 37 of file qwt_symbol.cpp.

QwtSymbol::~QwtSymbol  )  [virtual]
 

Destructor.

Definition at line 47 of file qwt_symbol.cpp.


Member Function Documentation

const QBrush& QwtSymbol::brush  )  const [inline]
 

Returns:
Brush

Definition at line 47 of file qwt_symbol.h.

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

void QwtSymbol::draw QPainter *  p,
const QRect &  r
const [virtual]
 

Draw the symbol into a bounding rectangle.

This function overrides the symbol's size settings, but it doesn't modify them.

Parameters:
p Painter
r Bounding rectangle
Note:
The symbol size won't be scaled by the device metrics

Definition at line 133 of file qwt_symbol.cpp.

References Cross, d_brush, d_pen, d_style, Diamond, QwtPainter::drawEllipse(), QwtPainter::drawLine(), QwtPainter::drawPolygon(), QwtPainter::drawRect(), DTriangle, Ellipse, LTriangle, Rect, RTriangle, Triangle, UTriangle, and XCross.

void QwtSymbol::draw QPainter *  p,
int  x,
int  y
const
 

Draw the symbol at a point (x,y).

Note:
The symbol size will be scaled by the device metrics of the paint device.

Definition at line 102 of file qwt_symbol.cpp.

References d_size, and draw().

void QwtSymbol::draw QPainter *  p,
const QPoint &  pt
const
 

Draw the symbol at a specified point.

Parameters:
p painter
pt point
Note:
The symbol size will be scaled by the device metrics of the paint device.

Definition at line 217 of file qwt_symbol.cpp.

Referenced by draw(), QwtMarker::draw(), QwtLegendButton::drawIdentifier(), and QwtCurve::drawSymbols().

bool QwtSymbol::operator!= const QwtSymbol  )  const
 

!= operator

Definition at line 252 of file qwt_symbol.cpp.

bool QwtSymbol::operator== const QwtSymbol  )  const
 

== operator

Definition at line 245 of file qwt_symbol.cpp.

References brush(), pen(), size(), and style().

const QPen& QwtSymbol::pen  )  const [inline]
 

Returns:
Pen

Definition at line 49 of file qwt_symbol.h.

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

void QwtSymbol::setBrush const QBrush &  br  ) 
 

Assign a brush.

The brush is used to draw the interior of the symbol.

Parameters:
br brush

Definition at line 80 of file qwt_symbol.cpp.

References d_brush.

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

void QwtSymbol::setPen const QPen &  pn  ) 
 

Assign a pen.

The pen is used to draw the symbol's outline.

Parameters:
pn pen

Definition at line 92 of file qwt_symbol.cpp.

References d_pen.

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

void QwtSymbol::setSize int  w,
int  h = -1
 

Specify the symbol's size.

If the 'h' parameter is left out or less than 0, and the 'w' parameter is greater than or equal to 0, the symbol size will be set to (w,w).

Parameters:
w width
h height (defaults to -1)

Definition at line 60 of file qwt_symbol.cpp.

References d_size.

void QwtSymbol::setSize const QSize &  s  ) 
 

Set the symbol's size.

Definition at line 68 of file qwt_symbol.cpp.

References d_size.

void QwtSymbol::setStyle QwtSymbol::Style  s  ) 
 

Specify the symbol style.

The following styles are defined:

QwtSymbol::None<dd>No Style. The symbol cannot be drawn.
QwtSymbol::Ellipse<dd>Ellipse or circle
QwtSymbol::Rect<dd>Rectangle
QwtSymbol::Diamond<dd>Diamond
QwtSymbol::Triangle<dd>Triangle pointing upwards
QwtSymbol::DTriangle<dd>Triangle pointing downwards
QwtSymbol::UTriangle<dd>Triangle pointing upwards
QwtSymbol::LTriangle<dd>Triangle pointing left
QwtSymbol::RTriangle<dd>Triangle pointing right
QwtSymbol::Cross<dd>Cross
QwtSymbol::XCross<dd>Diagonal cross
Parameters:
s style

Definition at line 239 of file qwt_symbol.cpp.

References d_style.

const QSize& QwtSymbol::size  )  const [inline]
 

Returns:
Size

Definition at line 51 of file qwt_symbol.h.

Referenced by QwtMarker::draw(), QwtLegendButton::drawIdentifier(), and operator==().

Style QwtSymbol::style  )  const [inline]
 

Returns:
Style

Definition at line 53 of file qwt_symbol.h.

Referenced by QwtPlot::closestMarker(), QwtMarker::draw(), QwtCurve::draw(), QwtLegendButton::drawIdentifier(), operator==(), and QwtPlot::updateLegendItem().


Member Data Documentation

QBrush QwtSymbol::d_brush [protected]
 

Definition at line 60 of file qwt_symbol.h.

Referenced by draw(), and setBrush().

QPen QwtSymbol::d_pen [protected]
 

Definition at line 61 of file qwt_symbol.h.

Referenced by draw(), and setPen().

QSize QwtSymbol::d_size [protected]
 

Definition at line 62 of file qwt_symbol.h.

Referenced by draw(), and setSize().

Style QwtSymbol::d_style [protected]
 

Definition at line 63 of file qwt_symbol.h.

Referenced by draw(), and setStyle().


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