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

QwtMarker Class Reference

A class for drawing markers. More...

#include <qwt_marker.h>

Inheritance diagram for QwtMarker::

QwtPlotMarker List of all members.

Public Types

enum  LineStyle { NoLine, HLine, VLine, Cross }

Public Methods

 QwtMarker ()
virtual ~QwtMarker ()
const QwtMarker & operator= (const QwtMarker &)
void setLineStyle (LineStyle st)
LineStyle lineStyle () const
void setSymbol (const QwtSymbol &s)
const QwtSymbolsymbol () const
void setLabel (const QString &txt)
const QString & label () const
void setLabelAlignment (int align)
int labelAlignment () const
void setLabelPen (const QPen &p)
const QPen & labelPen () const
void setLinePen (const QPen &p)
const QPen & linePen () const
void setFont (const QFont &f)
const QFont & font () const
virtual void draw (QPainter *p, int x, int y, const QRect &r)

Protected Methods

virtual void markerChanged ()

Detailed Description

A class for drawing markers.

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 QwtMarker::setSymbol() member assigns a symbol to the marker. The symbol is drawn at the specified point.

With QwtMarker::setLabel(), a label can be assigned to the marker. The QwtMarker::setLabelAlignment() 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 Enumeration Documentation

enum QwtMarker::LineStyle
 

Line styles.

See also:
QwtMarker::setLineStyle, QwtMarker::lineStyle


Constructor & Destructor Documentation

QwtMarker::QwtMarker  
 

Sets alignment to Qt::AlignCenter, and style to NoLine.

QwtMarker::~QwtMarker   [virtual]
 

Destructor.


Member Function Documentation

void QwtMarker::draw QPainter *    p,
int    x,
int    y,
const QRect &    r
[virtual]
 

Draw the marker.

Parameters:
p  Painter
x  X position
y  Y position
r  Bounding rectangle

const QFont & QwtMarker::font   const
 

Returns:
the font used for the label
See also:
QwtMarker::setFont()

const QString & QwtMarker::label   const
 

Returns:
the label
See also:
QwtMarker::setLabel()

int QwtMarker::labelAlignment   const
 

Returns:
the label alignment
See also:
QwtMarker::setLabelAlignment()

const QPen & QwtMarker::labelPen   const
 

Returns:
the label's pen
See also:
QwtMarker::setLabelPen()

const QPen & QwtMarker::linePen   const
 

Returns:
the line pen
See also:
QwtMarker::setLinePen()

QwtMarker::LineStyle QwtMarker::lineStyle   const
 

Returns:
the line style
See also:
For a description of line styles, see QwtMarker::setLineStyle()

void QwtMarker::markerChanged   [protected, virtual]
 

Notify a change of parameters.

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.

Reimplemented in QwtPlotMarker.

const QwtMarker & QwtMarker::operator= const QwtMarker &    m
 

Assignment operator.

Parameters:
m  Marker

void QwtMarker::setFont const QFont &    f
 

Specify the font for the label.

Parameters:
f  New font
See also:
QwtMarker::font()

void QwtMarker::setLabel const QString &    txt
 

Set the label.

Parameters:
txt  label text
See also:
QwtMarker::label()

void QwtMarker::setLabelAlignment int    align
 

Set the alignment of the label.

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

Parameters:
align  Alignment. A combination of AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter, AlgnHCenter, AlignVCenter.
See also:
QwtMarker::labelAlignment()

void QwtMarker::setLabelPen const QPen &    p
 

Specify a pen for the label.

Parameters:
p  New pen
See also:
QwtMarker::labelPen()

void QwtMarker::setLinePen const QPen &    p
 

Specify a pen for the line.

Parameters:
p  New pen
See also:
QwtMarker::linePen()

void QwtMarker::setLineStyle QwtMarker::LineStyle    st
 

Set the line style.

Parameters:
st  Line style. Can be one of QwtMarker::NoLine, QwtMarker::HLine, QwtMarker::VLine or QwtMarker::Cross
See also:
QwtMarker::lineStyle()

void QwtMarker::setSymbol const QwtSymbol   s
 

Assign a symbol.

Parameters:
s  New symbol
See also:
QwtSymbol, QwtMarker::symbol()

const QwtSymbol & QwtMarker::symbol   const
 

Returns:
the symbol
See also:
QwtMarker::setSymbol(), QwtSymbol


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