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 Methods

 QwtSymbol ()
 QwtSymbol (Style st, const QBrush &bd, const QPen &pn, const QSize &s)
virtual ~QwtSymbol ()
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)
void draw (QPainter *p, int x, int y)
virtual void draw (QPainter *p, const QRect &r)

Protected Attributes

QBrush d_brush
QPen d_pen
QSize d_size
QPointArray d_pa
Style d_style


Detailed Description

A class for drawing symbols.


Constructor & Destructor Documentation

QwtSymbol::QwtSymbol ( )
 

Default Constructor.

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

QwtSymbol::QwtSymbol ( QwtSymbol::Style st,
const QBrush & br,
const QPen & pn,
const QSize & s )
 

Constructor.

Parameters:
st   Symbol Style
bd   brush to fill the interior
pn   outline pen
size   size

QwtSymbol::~QwtSymbol ( ) [virtual]
 

Destructor.


Member Function Documentation

void QwtSymbol::draw ( QPainter * p,
const QRect & r ) [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

void QwtSymbol::draw ( QPainter * p,
int x,
int y )
 

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

The point (x,y) is the upper left corner of a rectangle with the symbol's size.

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

Draw the symbol at a specified point.

The point specifies the upper left corner of a rectangle with the symbol's size.

Parameters:
p   painter
pt   point

void QwtSymbol::setBrush ( const QBrush & br )
 

Assign a brush.

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

Parameters:
br   brush

void QwtSymbol::setPen ( const QPen & pn )
 

Assign a pen.

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

Parameters:
pn   pen

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)

void QwtSymbol::setSize ( const QSize & s )
 

Set the symbol's size.

void QwtSymbol::setStyle ( QwtSymbol::Style s )
 

Specify the symbol style.

The following styles are defined:

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


The documentation for this class was generated from the following files:
Generated at Thu Dec 14 00:27:21 2000 for Qwt User's Guide by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000