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 |
Line styles.
Definition at line 53 of file qwt_plot_marker.h.
QwtPlotMarker::QwtPlotMarker | ( | ) | [explicit] |
Sets alignment to Qt::AlignCenter, and style to NoLine.
Definition at line 54 of file qwt_plot_marker.cpp.
References QwtPlotItem::setZ().
QwtPlotMarker::~QwtPlotMarker | ( | ) | [virtual] |
int QwtPlotMarker::rtti | ( | ) | const [virtual] |
Reimplemented from QwtPlotItem.
Definition at line 68 of file qwt_plot_marker.cpp.
double QwtPlotMarker::xValue | ( | ) | const |
double QwtPlotMarker::yValue | ( | ) | const |
QwtDoublePoint QwtPlotMarker::value | ( | ) | const |
void QwtPlotMarker::setXValue | ( | double | x | ) |
void QwtPlotMarker::setYValue | ( | double | y | ) |
void QwtPlotMarker::setValue | ( | double | x, | |
double | y | |||
) |
Set Value.
Definition at line 98 of file qwt_plot_marker.cpp.
References QwtPlotItem::itemChanged().
Referenced by setValue(), setXValue(), and setYValue().
void QwtPlotMarker::setValue | ( | const QwtDoublePoint & | pos | ) |
void QwtPlotMarker::setLineStyle | ( | QwtPlotMarker::LineStyle | st | ) |
Set the line style.
st | Line style. Can be one of QwtPlotMarker::NoLine, HLine, VLine or Cross |
Definition at line 236 of file qwt_plot_marker.cpp.
References QwtPlotItem::itemChanged().
QwtPlotMarker::LineStyle QwtPlotMarker::lineStyle | ( | ) | const |
Definition at line 249 of file qwt_plot_marker.cpp.
void QwtPlotMarker::setLinePen | ( | const QPen & | p | ) |
Specify a pen for the line.
p | New pen |
Definition at line 340 of file qwt_plot_marker.cpp.
References QwtPlotItem::itemChanged().
const QPen & QwtPlotMarker::linePen | ( | ) | const |
void QwtPlotMarker::setSymbol | ( | const QwtSymbol & | s | ) |
Assign a symbol.
s | New symbol |
Definition at line 259 of file qwt_plot_marker.cpp.
References QwtSymbol::clone(), and QwtPlotItem::itemChanged().
const QwtSymbol & QwtPlotMarker::symbol | ( | ) | const |
Definition at line 270 of file qwt_plot_marker.cpp.
void QwtPlotMarker::setLabel | ( | const QwtText & | label | ) |
Set the label.
label | label text |
Definition at line 280 of file qwt_plot_marker.cpp.
References QwtPlotItem::itemChanged().
QwtText QwtPlotMarker::label | ( | ) | const |
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.
align | Alignment. A combination of AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter, AlgnHCenter, AlignVCenter. |
Definition at line 312 of file qwt_plot_marker.cpp.
References QwtPlotItem::itemChanged().
Qt::Alignment QwtPlotMarker::labelAlignment | ( | ) | const |
Definition at line 329 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.
p | Painter | |
xMap | x Scale Map | |
yMap | y Scale Map | |
r | Bounding rect, where to paint |
Implements QwtPlotItem.
Definition at line 127 of file qwt_plot_marker.cpp.
References QwtPainter::drawLine(), QwtPainter::metricsMap(), QwtMetricsMap::screenToLayoutX(), QwtMetricsMap::screenToLayoutY(), and QwtScaleMap::transform().
QwtDoubleRect QwtPlotMarker::boundingRect | ( | ) | const [virtual] |
Reimplemented from QwtPlotItem.
Definition at line 358 of file qwt_plot_marker.cpp.