Qwt Programmer's Manual

QwtSymbol


NAME

QwtSymbol - A class for drawing symbols

SYNOPSIS

#include <qwt_symbol.h>

PUBLIC MEMBERS

QwtSymbol (1)
Constructor
QwtSymbol (2)
Constructor
~QwtSymbol (3)
Destructor
draw (1)
Draw the symbol
draw (2)
Draw the symbol
draw (3)
Draw the symbol
setSize (1)
Change the size
setSize (2)
Change the size
setBrush
Assign a brush
setPen
Assign a pen
setStyle
Change the style
brush
Return the brush
pen
Return the pen
size
Return the size
style
Return the style

QwtSymbol::QwtSymbol (1)

Default Constructor

Syntax

QwtSymbol::QwtSymbol()

Description

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

QwtSymbol::QwtSymbol (2)

Constructor

Syntax

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

Parameters

QwtSymbol::Style st
Symbol Style
QBrush &bd
brush to fill the interior
QPen &pn
outline pen
QSize &size
size

QwtSymbol::~QwtSymbol

Destructor

Syntax

QwtSymbol::~QwtSymbol()

QwtSymbol::setSize (1)

Specify the symbol's size

Syntax

void QwtSymbol::setSize(int w, int h)

Parameters

int w
width
int h = -1
height

Description

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

QwtSymbol::setSize (2)

Set the symbol's size

Syntax

void QwtSymbol::setSize(const QSize &s)

Parameters

const QSize &s
new size

QwtSymbol::setBrush

Assign a brush

Syntax

void QwtSymbol::setBrush(const QBrush &br)

Parameters

const QBrush &br
brush

Description

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

QwtSymbol::setPen

Assign a pen

Syntax

void QwtSymbol::setPen(const QPen &pn)

Parameters

const QPen &pn
pen

Description

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

QwtSymbol::draw (1)

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

Syntax

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

Parameters

QPainter *p, int x, int y

Description

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

QwtSymbol::draw (2)

Draw the symbol into a bounding rectangle.

Syntax

void QwtSymbol::draw(QPainter *p, const QRect& r)

Parameters

QPainter *p
Painter
const QRect& r
Bounding rectangle

Description

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

QwtSymbol::draw (3)

Draw the symbol at a specified point

Syntax

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

Parameters

QPainter *p
painter
const QPoint &pt
point

Description

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

QwtSymbol::setStyle

Specify the symbol style

Syntax

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

Parameters

QwtSymbol::Style s
style

Description

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

Qwt Widget Library 27/04/96