Qwt Programmer's Manual
QwtMarker
QwtMarker - A class for drawing markers
#include <qwt_marker.h>
- 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
QwtMarker::markerChanged -- Notify a change of parameters
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.
Constructor
QwtMarker::QwtMarker()
Destructor
QwtMarker::~QwtMarker()
Draw the marker
void QwtMarker::draw(QPainter *p, int x, int y, const QRect &r)
- QPainter *p
- Painter
- int x, int y
- Position
- const QRect &r
- Bounding rectangle
Specify the font for the label
void QwtMarker::setFont(const QFont &f)
- const QFont &f
- new font
void QwtMarker::setLineStyle(QwtMarker::LineStyle st)
- QwtMarker::LineStyle st
- Line style. Can be one of QwtMarker::NoLine,
QwtMarker::HLine, QwtMarker::VLine or QwtMarker::Cross
Specify a symbol
void QwtMarker::setSymbol(const QwtSymbol &s)
- const QwtSymbol &s
- New symbol
Set the label
void QwtMarker::setLabel(const char *txt)
- const char *txt
- label text
Set the alignment of the label
void QwtMarker::setLabelAlignment(int align)
- int align
- Alignment. A combination of AlignTop, AlignBottom,
AlignLeft, AlignRight, AlignCenter, AlgnHCenter,
AlignVCenter.
The alignment determines where the label is drawn relative to
the marker's position.
Specify a pen for the line.
void QwtMarker::setLinePen(const QPen &p)
- const QPen &p
- New pen
Specify a pen for the label
void QwtMarker::setLabelPen(const QPen &p)
- const QPen &p
- New pen
Assignment operator
const QwtMarker& QwtMarker::operator=(const QwtMarker &m)
- const QwtMarker &m
- Marker
Return the line style
QwtMarker::LineStyle QwtMarker::lineStyle()
For a description of line styles, see setLineStyle
Return the symbol
const QwtSymbol & QwtMarker::symbol()
setSymbol, QwtSymbol
Return the label's pen
const Qpen & QwtMarker::labelPen()
setLabelPen
Return the line pen
const QPen & QwtMarker::line pen()
setLinePen
Return the font used for the label
const QFont & QwtMarker::font()
setFont
Return the label alignment
int QwtMarker::labelAlignment()
setLabelAlignment
Return the label
const QString & QwtMarker::label()
setLabel
Notify a change of parameters
void QwtMarker::markerChanged()
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