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.


Member Enumeration Documentation

enum QwtSymbol::Style
 

Style

See also:
QwtSymbol::setStyle, QwtSymbol::style


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

const QBrush& QwtSymbol::brush   const
 

Returns:
Brush.

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

const QPen& QwtSymbol::pen   const
 

Returns:
Pen.

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

const QSize& QwtSymbol::size   const
 

Returns:
Size.

Style QwtSymbol::style   const
 

Returns:
Style.


Generated on Tue May 28 15:31:01 2002 for Qwt User's Guide by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001