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.
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.
References QwtText::clone(), d_align, d_label, d_pen, d_style, and d_sym. |
|
Draw the marker.
References QwtText::boundingRect(), QwtText::draw(), QwtSymbol::draw(), QwtPainter::drawLine(), QwtPainter::metricsMap(), QwtSymbol::size(), QwtSymbol::style(), and QwtText::text(). Referenced by QwtPlot::drawCanvasItems(). |
|
References QwtText::font(). Referenced by QwtPlotPrintFilter::apply(), and QwtPlot::markerFont(). |
|
References QwtText::text(). Referenced by QwtPlot::markerLabel(), and setLabel(). |
|
Referenced by QwtPlot::markerLabelAlign(). |
|
References QwtText::color(). |
|
References QwtText::color(). Referenced by QwtPlotPrintFilter::apply(), QwtPlot::markerLabelPen(), and QwtPlotPrintFilter::reset(). |
|
Referenced by QwtPlotPrintFilter::apply(), QwtPlot::markerLinePen(), and QwtPlotPrintFilter::reset(). |
|
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.
References QwtText::clone(), d_align, d_label, d_pen, d_style, and d_sym. |
|
Specify the font for the label.
References QwtText::font(), markerChanged(), and QwtText::setFont(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setMarkerFont(). |
|
Set the label.
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.
References markerChanged(). Referenced by QwtPlot::insertLineMarker(), and QwtPlot::setMarkerLabelAlign(). |
|
Specify a color for the label.
References QwtText::color(), markerChanged(), and QwtText::setColor(). |
|
Specify a pen for the label.
References QwtText::color(), markerChanged(), and QwtText::setColor(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), QwtPlot::setMarkerLabelPen(), and QwtPlot::setMarkerPen(). |
|
Set the label text.
References QwtText::color(), QwtText::font(), QwtText::rectBrush(), QwtText::rectPen(), and setLabel(). Referenced by QwtPlot::setMarkerLabelText(). |
|
Specify a pen for the line.
References markerChanged(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), QwtPlot::setMarkerLinePen(), and QwtPlot::setMarkerPen(). |
|
Set the line style.
References markerChanged(). Referenced by QwtPlot::insertLineMarker(), and QwtPlot::setMarkerLineStyle(). |
|
Assign a symbol.
References markerChanged(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setMarkerSymbol(). |
|
Referenced by QwtPlotPrintFilter::apply(), QwtPlot::closestMarker(), QwtPlot::markerSymbol(), and QwtPlotPrintFilter::reset(). |