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

QwtSymbol Class Reference

List of all members.

Detailed Description

A class for drawing symbols.


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


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

QwtSymbol::~QwtSymbol  )  [virtual]
 

Destructor.


Member Function Documentation

const QBrush& QwtSymbol::brush  )  const
 

Return Brush.

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

Draw the symbol into a bounding rectangle.

This function assumes that the painter has been initialized with brush and pen before. This allows a much more performant implementation when painting many symbols with the same brush and pen like in curves.

Parameters:
painter Painter
r Bounding rectangle

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

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

void QwtSymbol::draw QPainter *  painter,
const QPoint &  pos
const
 

Draw the symbol at a specified point.

Parameters:
painter Painter
pos Center of the symbol

bool QwtSymbol::operator!= const QwtSymbol  )  const
 

!= operator

bool QwtSymbol::operator== const QwtSymbol  )  const
 

== operator

const QPen& QwtSymbol::pen  )  const
 

Return 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<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

const QSize& QwtSymbol::size  )  const
 

Return Size.

Style QwtSymbol::style  )  const
 

Return Style.


Generated on Tue Nov 4 09:53:54 2003 for Qwt User's Guide by doxygen 1.3.4