Qwt User's Guide: QwtPlotMarker Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# QwtPlotMarker Class Reference

Inheritance diagram for QwtPlotMarker:

[legend]
Collaboration diagram for QwtPlotMarker:

[legend]
List of all members.

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

With QwtPlotMarker::setLabel(), a label can be assigned to the marker. The QwtPlotMarker::setLabelAlignment() member specifies where the label is drawn. All the Align*-constants in Qt::AlignmentFlags (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.

Definition at line 45 of file qwt_plot_marker.h.

## Public Types
enum | LineStyle { NoLine, HLine, VLine, Cross }
## Public Member Functions
| QwtPlotMarker ()
virtual | ~QwtPlotMarker ()
virtual int | rtti () const
double | xValue () const
double | yValue () const
QwtDoublePoint | value () const
void | setXValue (double)
void | setYValue (double)
void | setValue (double, double)
void | setValue (const QwtDoublePoint &)
void | setLineStyle (LineStyle st)
LineStyle | lineStyle () const
void | setLinePen (const QPen &p)
const QPen & | linePen () const
void | setSymbol (const QwtSymbol &s)
const QwtSymbol & | symbol () const
void | setLabel (const QwtText &)
QwtText | label () const
void | setLabelAlignment (Qt::Alignment)
Qt::Alignment | labelAlignment () const
virtual void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &) const
virtual QwtDoubleRect | boundingRect () const

## Member Enumeration Documentation

enum QwtPlotMarker::LineStyle

| Line styles. See also: QwtPlotMarker::setLineStyle, QwtPlotMarker::lineStyle Definition at line 53 of file qwt_plot_marker.h.

## Constructor & Destructor Documentation

QwtPlotMarker::QwtPlotMarker | ( |  | ) | `[explicit]`

| Sets alignment to Qt::AlignCenter, and style to NoLine. Definition at line 48 of file qwt_plot_marker.cpp. References QwtPlotItem::setZ().

QwtPlotMarker::~QwtPlotMarker | ( |  | ) | `[virtual]`

| Destructor. Definition at line 56 of file qwt_plot_marker.cpp.

## Member Function Documentation

QwtDoubleRect QwtPlotMarker::boundingRect | ( |  | ) | const`[virtual]`

| Returns: An invalid bounding rect: QwtDoubleRect(1.0, 1.0, -2.0, -2.0) Reimplemented from QwtPlotItem. Definition at line 350 of file qwt_plot_marker.cpp.

void QwtPlotMarker::draw | ( | QPainter * | p,
|  | const QwtScaleMap & | xMap,
|  | const QwtScaleMap & | yMap,
|  | const QRect & | r
| ) | const`[virtual]`

  | Draw the marker. Parameters:
  | p | Painter
  | xMap | x Scale Map
  | yMap | y Scale Map
  | r | Bounding rect, where to paint
Implements QwtPlotItem. Definition at line 120 of file qwt_plot_marker.cpp. References QwtPainter::drawLine(), and QwtScaleMap::transform().

QwtText QwtPlotMarker::label | ( |  | ) | const

| Returns: the label See also: setLabel() Definition at line 285 of file qwt_plot_marker.cpp. Referenced by setLabel().

Qt::Alignment QwtPlotMarker::labelAlignment | ( |  | ) | const

| Returns: the label alignment See also: setLabelAlignment() Definition at line 321 of file qwt_plot_marker.cpp.

const QPen & QwtPlotMarker::linePen | ( |  | ) | const

| Returns: the line pen See also: setLinePen() Definition at line 345 of file qwt_plot_marker.cpp.

QwtPlotMarker::LineStyle QwtPlotMarker::lineStyle | ( |  | ) | const

| Returns: the line style See also: For a description of line styles, see QwtPlotMarker::setLineStyle() Definition at line 242 of file qwt_plot_marker.cpp.

void QwtPlotMarker::setLabel | ( | const QwtText & | label | ) |

  | Set the label. Parameters:
  | label | label text
See also: label() Definition at line 272 of file qwt_plot_marker.cpp. References QwtPlotItem::itemChanged(), and label().

void QwtPlotMarker::setLabelAlignment | ( | Qt::Alignment | 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: labelAlignment() Definition at line 304 of file qwt_plot_marker.cpp.

void QwtPlotMarker::setLinePen | ( | const QPen & | p | ) |

  | Specify a pen for the line. Parameters:
  | p | New pen
See also: linePen() Definition at line 332 of file qwt_plot_marker.cpp. References QwtPlotItem::itemChanged().

void QwtPlotMarker::setLineStyle | ( | QwtPlotMarker::LineStyle | st | ) |

  | Set the line style. Parameters:
  | st | Line style. Can be one of QwtPlotMarker::NoLine, HLine, VLine or Cross
See also: lineStyle() Definition at line 229 of file qwt_plot_marker.cpp. References QwtPlotItem::itemChanged().

void QwtPlotMarker::setSymbol | ( | const QwtSymbol & | s | ) |

  | Assign a symbol. Parameters:
  | s | New symbol
See also: symbol() Definition at line 252 of file qwt_plot_marker.cpp. References QwtPlotItem::itemChanged().

void QwtPlotMarker::setValue | ( | const QwtDoublePoint & |  | ) |

| Set Value. Definition at line 85 of file qwt_plot_marker.cpp. References setValue().

void QwtPlotMarker::setValue | ( | double | ,
|  | double |
| ) |

| Set Value. Definition at line 91 of file qwt_plot_marker.cpp. References QwtPlotItem::itemChanged(). Referenced by setValue(), setXValue(), and setYValue().

void QwtPlotMarker::setXValue | ( | double |  | ) |

| Set X Value. Definition at line 102 of file qwt_plot_marker.cpp. References setValue().

void QwtPlotMarker::setYValue | ( | double |  | ) |

| Set Y Value. Definition at line 108 of file qwt_plot_marker.cpp. References setValue().

const QwtSymbol & QwtPlotMarker::symbol | ( |  | ) | const

| Returns: the symbol See also: setSymbol(), QwtSymbol Definition at line 262 of file qwt_plot_marker.cpp.

QwtDoublePoint QwtPlotMarker::value | ( |  | ) | const

| Return Value. Definition at line 67 of file qwt_plot_marker.cpp.

double QwtPlotMarker::xValue | ( |  | ) | const

| Return x Value. Definition at line 73 of file qwt_plot_marker.cpp.

double QwtPlotMarker::yValue | ( |  | ) | const

| Return y Value. Definition at line 79 of file qwt_plot_marker.cpp.