QwtCompass Class Reference

Inheritance diagram for QwtCompass:

Inheritance graph
[legend]
Collaboration diagram for QwtCompass:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Compass Widget.

QwtCompass is a widget to display and enter directions. It consists of a scale, an optional needle and rose.

dials1.png

Note:
The examples/dials example shows how to use QwtCompass.

Definition at line 48 of file qwt_compass.h.

Public Member Functions

 QwtCompass (QWidget *parent=NULL)
virtual ~QwtCompass ()
void setRose (QwtCompassRose *rose)
const QwtCompassRoserose () const
QwtCompassRoserose ()
const QMap< double, QString > & labelMap () const
QMap< double, QString > & labelMap ()
void setLabelMap (const QMap< double, QString > &map)

Protected Member Functions

virtual QwtText scaleLabel (double value) const
virtual void drawRose (QPainter *, const QPoint &center, int radius, double north, QPalette::ColorGroup) const
virtual void drawScaleContents (QPainter *, const QPoint &center, int radius) const
virtual void keyPressEvent (QKeyEvent *)


Constructor & Destructor Documentation

QwtCompass::QwtCompass QWidget *  parent = NULL  )  [explicit]
 

Constructor.

Parameters:
parent Parent widget
Create a compass widget with a scale, no needle and no rose. The default origin is 270.0 with no valid value. It accepts mouse and keyboard inputs and has no step size. The default mode is QwtDial::RotateNeedle.

Definition at line 50 of file qwt_compass.cpp.

QwtCompass::~QwtCompass  )  [virtual]
 

Destructor.

Definition at line 77 of file qwt_compass.cpp.


Member Function Documentation

void QwtCompass::drawRose QPainter *  painter,
const QPoint &  center,
int  radius,
double  north,
QPalette::ColorGroup  cg
const [protected, virtual]
 

Draw the compass rose

Parameters:
painter Painter
center Center of the compass
radius of the circle, where to paint the rose
north Direction pointing north, in degrees counter clockwise
cg Color group

Definition at line 143 of file qwt_compass.cpp.

Referenced by drawScaleContents().

void QwtCompass::drawScaleContents QPainter *  ,
const QPoint &  center,
int  radius
const [protected, virtual]
 

Draw the contents of the scale.

Reimplemented from QwtDial.

Definition at line 114 of file qwt_compass.cpp.

References drawRose(), QwtAbstractSlider::isValid(), QwtDial::mode(), QwtDial::origin(), and QwtDoubleRange::value().

void QwtCompass::keyPressEvent QKeyEvent *  kev  )  [protected, virtual]
 

Handles key events

Beside the keys described in QwtDial::keyPressEvent numbers from 1-9 (without 5) set the direction according to their position on the num pad.

See also:
isReadOnly()

Reimplemented from QwtDial.

Definition at line 196 of file qwt_compass.cpp.

References QwtAbstractSlider::isReadOnly().

QMap< double, QString > & QwtCompass::labelMap  ) 
 

Returns:
map, mapping values to labels
See also:
setLabelMap()

Definition at line 265 of file qwt_compass.cpp.

const QMap< double, QString > & QwtCompass::labelMap  )  const
 

Returns:
map, mapping values to labels
See also:
setLabelMap()

Definition at line 256 of file qwt_compass.cpp.

QwtCompassRose * QwtCompass::rose  ) 
 

Returns:
rose
See also:
setRose()

Definition at line 182 of file qwt_compass.cpp.

const QwtCompassRose * QwtCompass::rose  )  const
 

Returns:
rose
See also:
setRose()

Definition at line 173 of file qwt_compass.cpp.

Referenced by setRose().

QwtText QwtCompass::scaleLabel double  value  )  const [protected, virtual]
 

Map a value to a corresponding label

Parameters:
value Value that will be mapped
Returns:
Label, or QString::null
label() looks in a map for a corresponding label for value or return an null text.
See also:
labelMap(), setLabelMap()

Reimplemented from QwtDial.

Definition at line 297 of file qwt_compass.cpp.

void QwtCompass::setLabelMap const QMap< double, QString > &  map  ) 
 

Set a map, mapping values to labels.

Parameters:
map value to label map
The values of the major ticks are found by looking into this map. The default map consists of the labels N, NE, E, SE, S, SW, W, NW.

Warning:
The map will have no effect for values that are no major tick values. Major ticks can be changed by QwtScaleDraw::setScale
See also:
labelMap(), scaleDraw(), setScale()

Definition at line 282 of file qwt_compass.cpp.

void QwtCompass::setRose QwtCompassRose rose  ) 
 

Set a rose for the compass

Parameters:
rose Compass rose
Warning:
The rose will be deleted, when a different rose is set or in ~QwtCompass
See also:
rose()

Definition at line 157 of file qwt_compass.cpp.

References rose().


Generated on Mon Feb 26 21:23:12 2007 for Qwt User's Guide by  doxygen 1.4.6