Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

QwtPlotMarker Class Reference

Inheritance diagram for QwtPlotMarker:

Inheritance graph
[legend]
Collaboration diagram for QwtPlotMarker:

Collaboration graph
[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 ()
 QwtPlotMarker (const QwtPlotMarker &)
QwtPlotMarkeroperator= (const 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 setSymbol (const QwtSymbol &s)
const QwtSymbolsymbol () 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, 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 53 of file qwt_plot_marker.cpp.

QwtPlotMarker::~QwtPlotMarker  )  [virtual]
 

Destructor.

Definition at line 60 of file qwt_plot_marker.cpp.

QwtPlotMarker::QwtPlotMarker const QwtPlotMarker m  ) 
 

Copy constructor.

Parameters:
m Marker

Definition at line 69 of file qwt_plot_marker.cpp.


Member Function Documentation

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

Draw the marker.

Parameters:
p Painter

Implements QwtPlotItem.

Definition at line 150 of file qwt_plot_marker.cpp.

References QwtPainter::drawLine(), QwtPainter::metricsMap(), QwtDoublePoint::x(), and QwtDoublePoint::y().

const QFont QwtPlotMarker::font  )  const
 

Returns:
the font used for the label
See also:
QwtPlotMarker::setFont()

Definition at line 277 of file qwt_plot_marker.cpp.

Referenced by setLabel().

const QString QwtPlotMarker::label  )  const
 

Returns:
the label
See also:
QwtPlotMarker::setLabel()

Definition at line 370 of file qwt_plot_marker.cpp.

References QwtText::text().

Referenced by operator=(), and setLabel().

int QwtPlotMarker::labelAlignment  )  const
 

Returns:
the label alignment
See also:
QwtPlotMarker::setLabelAlignment()

Definition at line 399 of file qwt_plot_marker.cpp.

const QColor QwtPlotMarker::labelColor  )  const
 

Returns:
the label's color
See also:
QwtPlotMarker::setLabelPen()

Definition at line 445 of file qwt_plot_marker.cpp.

References QwtText::color().

const QPen QwtPlotMarker::labelPen  )  const
 

Returns:
the label's pen
See also:
QwtPlotMarker::setLabelPen()
Warning:
This function is deprecated. Use QwtPlotMarker::labelColor.

Definition at line 470 of file qwt_plot_marker.cpp.

const QPen & QwtPlotMarker::linePen  )  const
 

Returns:
the line pen
See also:
QwtPlotMarker::setLinePen()

Definition at line 422 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 302 of file qwt_plot_marker.cpp.

QwtPlotMarker & QwtPlotMarker::operator= const QwtPlotMarker m  ) 
 

Assignment operator.

Parameters:
m Marker

Definition at line 79 of file qwt_plot_marker.cpp.

References d_data, label(), xValue(), and yValue().

void QwtPlotMarker::setFont const QFont &  f  ) 
 

Specify the font for the label.

Parameters:
f New font
See also:
QwtPlotMarker::font()

Definition at line 264 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged().

Referenced by QwtPlotPrintFilter::reset().

void QwtPlotMarker::setLabel const QString &  text,
const QFont &  font = QFont(),
const QColor &  color = QColor(),
const QPen &  pen = QPen(Qt::NoPen),
const QBrush &  brush = QBrush(Qt::NoBrush)
 

Set the label.

Parameters:
text Contents of the label text
font Font of the label text
color Color of the label text
pen Pen to draw the enclosing rectangle
brush Brush to draw the enclosing rectangle
See also:
QwtPlotMarker::label()

Definition at line 347 of file qwt_plot_marker.cpp.

References font(), QwtPlotItem::itemChanged(), label(), and QwtText::makeText().

Referenced by setLabelText().

void QwtPlotMarker::setLabelAlignment int  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:
QwtPlotMarker::labelAlignment()

Definition at line 386 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged().

void QwtPlotMarker::setLabelColor const QColor &  color  ) 
 

Specify a color for the label.

Parameters:
color Color of the label text
See also:
QwtPlotMarker::labelColor()

Definition at line 432 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged(), and QwtText::setColor().

void QwtPlotMarker::setLabelPen const QPen &  p  ) 
 

Specify a pen for the label.

Parameters:
p New pen
See also:
QwtPlotMarker::labelPen()
Warning:
This function is deprecated. Use QwtPlotMarker::setLabelColor.

Definition at line 456 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged(), and QwtText::setColor().

void QwtPlotMarker::setLabelText const QString &  text  ) 
 

Set the label text.

Parameters:
text label text
See also:
QwtPlotMarker::label()

Definition at line 332 of file qwt_plot_marker.cpp.

References setLabel().

void QwtPlotMarker::setLinePen const QPen &  p  ) 
 

Specify a pen for the line.

Parameters:
p New pen
See also:
QwtPlotMarker::linePen()

Definition at line 409 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, QwtPlotMarker::HLine, QwtPlotMarker::VLine or QwtPlotMarker::Cross
See also:
QwtPlotMarker::lineStyle()

Definition at line 289 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged().

void QwtPlotMarker::setSymbol const QwtSymbol s  ) 
 

Assign a symbol.

Parameters:
s New symbol
See also:
QwtSymbol, QwtPlotMarker::symbol()

Definition at line 312 of file qwt_plot_marker.cpp.

References QwtPlotItem::itemChanged().

void QwtPlotMarker::setXValue double   ) 
 

Set X Value.

Definition at line 135 of file qwt_plot_marker.cpp.

void QwtPlotMarker::setYValue double   ) 
 

Set Y Value.

Definition at line 141 of file qwt_plot_marker.cpp.

const QwtSymbol & QwtPlotMarker::symbol  )  const
 

Returns:
the symbol
See also:
QwtPlotMarker::setSymbol(), QwtSymbol

Definition at line 322 of file qwt_plot_marker.cpp.

double QwtPlotMarker::xValue  )  const
 

Return x Value.

Definition at line 108 of file qwt_plot_marker.cpp.

Referenced by operator=().

double QwtPlotMarker::yValue  )  const
 

Return y Value.

Definition at line 114 of file qwt_plot_marker.cpp.

Referenced by operator=().


Generated on Wed Aug 31 23:03:42 2005 for Qwt User's Guide by  doxygen 1.4.1