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

QwtMarker Class Reference

Inheritance diagram for QwtMarker:

QwtPlotMarker 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 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.


Public Types

enum  LineStyle {
  NoLine,
  HLine,
  VLine,
  Cross
}

Public Member Functions

 QwtMarker ()
virtual ~QwtMarker ()
 QwtMarker (const QwtMarker &)
QwtMarkeroperator= (const QwtMarker &)
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, int x, int y, const QRect &r)

Protected Member Functions

virtual void markerChanged ()


Member Enumeration Documentation

enum QwtMarker::LineStyle
 

Line styles.

See also:
QwtMarker::setLineStyle, QwtMarker::lineStyle


Constructor & Destructor Documentation

QwtMarker::QwtMarker  ) 
 

Sets alignment to Qt::AlignCenter, and style to NoLine.

QwtMarker::~QwtMarker  )  [virtual]
 

Destructor.

QwtMarker::QwtMarker const QwtMarker m  ) 
 

Copy constructor.

Parameters:
m Marker


Member Function Documentation

void QwtMarker::draw QPainter *  p,
int  x,
int  y,
const QRect &  r
[virtual]
 

Draw the marker.

Parameters:
p Painter
x X position
y Y position
r Bounding rectangle

const QFont QwtMarker::font  )  const
 

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

const QString QwtMarker::label  )  const
 

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

int QwtMarker::labelAlignment  )  const
 

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

const QColor QwtMarker::labelColor  )  const
 

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

const QPen QwtMarker::labelPen  )  const
 

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

const QPen & QwtMarker::linePen  )  const
 

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

QwtMarker::LineStyle QwtMarker::lineStyle  )  const
 

Returns:
the line style
See also:
For a description of line styles, see QwtMarker::setLineStyle()

void QwtMarker::markerChanged  )  [protected, virtual]
 

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.

QwtMarker & QwtMarker::operator= const QwtMarker m  ) 
 

Assignment operator.

Parameters:
m Marker

void QwtMarker::setFont const QFont &  f  ) 
 

Specify the font for the label.

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

void QwtMarker::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:
QwtMarker::label()

void QwtMarker::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:
QwtMarker::labelAlignment()

void QwtMarker::setLabelColor const QColor &  color  ) 
 

Specify a color for the label.

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

void QwtMarker::setLabelPen const QPen &  p  ) 
 

Specify a pen for the label.

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

void QwtMarker::setLabelText const QString &  text  ) 
 

Set the label text.

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

void QwtMarker::setLinePen const QPen &  p  ) 
 

Specify a pen for the line.

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

void QwtMarker::setLineStyle QwtMarker::LineStyle  st  ) 
 

Set the line style.

Parameters:
st Line style. Can be one of QwtMarker::NoLine, QwtMarker::HLine, QwtMarker::VLine or QwtMarker::Cross
See also:
QwtMarker::lineStyle()

void QwtMarker::setSymbol const QwtSymbol s  ) 
 

Assign a symbol.

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

const QwtSymbol & QwtMarker::symbol  )  const
 

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


Generated on Tue Nov 4 09:53:49 2003 for Qwt User's Guide by doxygen 1.3.4