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 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 43 of file qwt_marker.h.
Public Types | |
enum | LineStyle { NoLine, HLine, VLine, Cross } |
Public Member Functions | |
QwtMarker () | |
virtual | ~QwtMarker () |
QwtMarker (const QwtMarker &) | |
QwtMarker & | operator= (const QwtMarker &) |
void | setLineStyle (LineStyle st) |
LineStyle | lineStyle () const |
void | setSymbol (const QwtSymbol &s) |
const QwtSymbol & | symbol () const |
void | setLabel (const QString &text, const QFont &font=QFont(), const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush)) |
void | setLabelText (const QString &text) |
const QString | label () const |
void | setLabelAlignment (int align) |
int | labelAlignment () const |
void | setLabelColor (const QColor &c) |
const QColor | labelColor () 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 Member Functions | |
virtual void | markerChanged () |
|
Line styles.
Definition at line 51 of file qwt_marker.h. Referenced by lineStyle(). |
|
Sets alignment to Qt::AlignCenter, and style to NoLine.
Definition at line 20 of file qwt_marker.cpp. References QwtText::makeText(). |
|
Destructor.
Definition at line 29 of file qwt_marker.cpp. |
|
Copy constructor.
Definition at line 38 of file qwt_marker.cpp. References QwtText::clone(), d_align, d_label, d_pen, d_style, and d_sym. |
|
Draw the marker.
Definition at line 72 of file qwt_marker.cpp. References QwtText::boundingRect(), QwtText::draw(), QwtSymbol::draw(), QwtPainter::drawLine(), QwtPainter::metricsMap(), QwtSymbol::size(), QwtSymbol::style(), and QwtText::text(). Referenced by QwtPlot::drawCanvasItems(). |
|
Definition at line 189 of file qwt_marker.cpp. References QwtText::font(). Referenced by QwtPlotPrintFilter::apply(), and QwtPlot::markerFont(). |
|
Definition at line 282 of file qwt_marker.cpp. References QwtText::text(). Referenced by QwtPlot::markerLabel(), and setLabel(). |
|
Definition at line 311 of file qwt_marker.cpp. Referenced by QwtPlot::markerLabelAlign(). |
|
Definition at line 357 of file qwt_marker.cpp. References QwtText::color(). |
|
Definition at line 382 of file qwt_marker.cpp. References QwtText::color(). Referenced by QwtPlotPrintFilter::apply(), QwtPlot::markerLabelPen(), and QwtPlotPrintFilter::reset(). |
|
Definition at line 334 of file qwt_marker.cpp. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::markerLinePen(), and QwtPlotPrintFilter::reset(). |
|
Definition at line 214 of file qwt_marker.cpp. References LineStyle. Referenced by QwtPlot::closestMarker(), and QwtPlot::markerLineStyle(). |
|
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. Definition at line 395 of file qwt_marker.cpp. Referenced by setFont(), setLabel(), setLabelAlignment(), setLabelColor(), setLabelPen(), setLinePen(), setLineStyle(), setSymbol(), QwtPlotMarker::setXValue(), and QwtPlotMarker::setYValue(). |
|
Assignment operator.
Definition at line 51 of file qwt_marker.cpp. References QwtText::clone(), d_align, d_label, d_pen, d_style, and d_sym. |
|
Specify the font for the label.
Definition at line 176 of file qwt_marker.cpp. References QwtText::font(), markerChanged(), and QwtText::setFont(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setMarkerFont(). |
|
Set the label.
Definition at line 259 of file qwt_marker.cpp. References QwtText::alignment(), QwtText::color(), QwtText::font(), label(), QwtText::makeText(), markerChanged(), QwtText::rectBrush(), QwtText::rectPen(), and QwtText::text(). Referenced by QwtPlot::insertLineMarker(), QwtPlot::insertMarker(), setLabelText(), and QwtPlot::setMarkerLabel(). |
|
Set the alignment of the label. The alignment determines where the label is drawn relative to the marker's position.
Definition at line 298 of file qwt_marker.cpp. References markerChanged(). Referenced by QwtPlot::insertLineMarker(), and QwtPlot::setMarkerLabelAlign(). |
|
Specify a color for the label.
Definition at line 344 of file qwt_marker.cpp. References QwtText::color(), markerChanged(), and QwtText::setColor(). |
|
Specify a pen for the label.
Definition at line 368 of file qwt_marker.cpp. References QwtText::color(), markerChanged(), and QwtText::setColor(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), QwtPlot::setMarkerLabelPen(), and QwtPlot::setMarkerPen(). |
|
Set the label text.
Definition at line 244 of file qwt_marker.cpp. References QwtText::color(), QwtText::font(), QwtText::rectBrush(), QwtText::rectPen(), and setLabel(). Referenced by QwtPlot::setMarkerLabelText(). |
|
Specify a pen for the line.
Definition at line 321 of file qwt_marker.cpp. References markerChanged(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), QwtPlot::setMarkerLinePen(), and QwtPlot::setMarkerPen(). |
|
Set the line style.
Definition at line 201 of file qwt_marker.cpp. References markerChanged(). Referenced by QwtPlot::insertLineMarker(), and QwtPlot::setMarkerLineStyle(). |
|
Assign a symbol.
Definition at line 224 of file qwt_marker.cpp. References markerChanged(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setMarkerSymbol(). |
|
Definition at line 234 of file qwt_marker.cpp. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::closestMarker(), QwtPlot::markerSymbol(), and QwtPlotPrintFilter::reset(). |