Qwt Programmer's Manual

QwtMarker


NAME

QwtMarker - A class for drawing markers

SYNOPSIS

#include <qwt_marker.h>

PUBLIC MEMBERS

QwtMarker
Constructor
~QwtMarker
Destructor
operator=
Assignment operator
setLineStyle
Set the line style
setSymbol
Assign a symbol
setLabel
Assign a label
setLabelAlignment
Set the label's alignment
setLabelPen
Assign a pen for drawing the label
setLinePen
Assign a pen for drawing the line
setFont
Assign a font for the label
lineStyle
Return the line style
symbol
Return the symbol
labelPen
Return the label's pen
linePen
Return the line pen
font
Return the font
labelAlignment
Return the label's alignment
label
Return the label

PROTECTED MEMBERS

QwtMarker::markerChanged -- Notify a change of parameters

DESCRIPTION

A marker can be a horizontal line, a vertical line, a symbol, a label or any combination of them, which can be drawn around a center point inside a bounding rectangle. The setSymbol member assigns a symbol to the marker. The symbol is drawn at the specified point. With setLabel, a label can be assigned to the marker. The setAlignment member specifies where the label is drawn. All the Align*-constants in qwindefs.h (see Qt documentation) are valid. The interpretation of the alignment depends on the marker's line style. The alignment refers to the center point of the marker, which means, for example, that the label would be printed left above the center point if the alignment was set to AlignLeft|AlignTop.

MEMBER FUNCTION DESCRIPTION


QwtMarker::QwtMarker

Constructor

Syntax

QwtMarker::QwtMarker()

QwtMarker::~QwtMarker

Destructor

Syntax

QwtMarker::~QwtMarker()

QwtMarker::draw

Draw the marker

Syntax

void QwtMarker::draw(QPainter *p, int x, int y, const QRect &r)

Parameters

QPainter *p
Painter
int x, int y
Position
const QRect &r
Bounding rectangle

QwtMarker::setFont

Specify the font for the label

Syntax

void QwtMarker::setFont(const QFont &f)

Parameters

const QFont &f
new font

QwtMarker::setLineStyle

Syntax

void QwtMarker::setLineStyle(QwtMarker::LineStyle st)

Parameters

QwtMarker::LineStyle st
Line style. Can be one of QwtMarker::NoLine, QwtMarker::HLine, QwtMarker::VLine or QwtMarker::Cross

QwtMarker::setSymbol

Specify a symbol

Syntax

void QwtMarker::setSymbol(const QwtSymbol &s)

Parameters

const QwtSymbol &s
New symbol

QwtMarker::setLabel

Set the label

Syntax

void QwtMarker::setLabel(const char *txt)

Parameters

const char *txt
label text

QwtMarker::setLabelAlignment

Set the alignment of the label

Syntax

void QwtMarker::setLabelAlignment(int align)

Parameters

int align
Alignment. A combination of AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter, AlgnHCenter, AlignVCenter.

Description

The alignment determines where the label is drawn relative to the marker's position.

QwtMarker::setLinePen

Specify a pen for the line.

Syntax

void QwtMarker::setLinePen(const QPen &p)

Parameters

const QPen &p
New pen

QwtMarker::setLabelPen

Specify a pen for the label

Syntax

void QwtMarker::setLabelPen(const QPen &p)

Parameters

const QPen &p
New pen

QwtMarker::operator=

Assignment operator

Syntax

const QwtMarker& QwtMarker::operator=(const QwtMarker &m)

Parameters

const QwtMarker &m
Marker

QwtMarker::lineStyle

Return the line style

Syntax

QwtMarker::LineStyle QwtMarker::lineStyle()

Description

For a description of line styles, see setLineStyle

QwtMarker::symbol

Return the symbol

Syntax

const QwtSymbol & QwtMarker::symbol()

See also

setSymbol, QwtSymbol

QwtMarker::labelPen

Return the label's pen

Syntax

const Qpen & QwtMarker::labelPen()

See also

setLabelPen

QwtMarker::line pen

Return the line pen

Syntax

const QPen & QwtMarker::line pen()

See Also

setLinePen

QwtMarker::font

Return the font used for the label

Syntax

const QFont & QwtMarker::font()

See Also

setFont

QwtMarker::labelAlignment

Return the label alignment

Syntax

int QwtMarker::labelAlignment()

See Also

setLabelAlignment

QwtMarker::label

Return the label

Syntax

const QString & QwtMarker::label()

See Also

setLabel

QwtMarker::markerChanged

Notify a change of parameters

Syntax

void QwtMarker::markerChanged()

Description

This virtual function is called when a marker property has been changed and redrawing is advisable. It can be reimplemented by derived classes. The default implementation does nothing.
QwtWidget Library 01/01/98