A compass rose with a wind-direction arrow.
More...
Public Slots |
| void | setDirection (int degrees) |
| | Set the direction.
|
| void | setDirection (double degrees) |
| | Set the direction as a double value.
|
Protected Slots |
| void | onValueChanged (int val) |
| | Convert the base class value to a direction (180 degree change).
|
Protected Member Functions |
| virtual void | paintEvent (QPaintEvent *event) |
| | Override the paint event to draw the widget.
|
| virtual void | resizeEvent (QResizeEvent *event) |
| | Override the resize event to change how the widget is displayed.
|
| virtual void | drawCompass (QPainter &painter, QRectF &rect) |
| | Utility function to draw the compass background.
|
| virtual void | drawCompassTick (QPainter &painter) |
| | Utility function to draw the compass tick.
|
| virtual void | drawHeadingNorth (QPainter &painter) |
| | Utility function to draw the letter N.
|
| virtual void | drawDirection (QPainter &painter, QRectF &rect) |
| | Utility function to draw the direction from.
|
| virtual void | drawNeedle (QPainter &painter) |
| | Utility function to draw the needle.
|
Private Member Functions |
| int | convert (int val) const |
| | Utility to convert from base class value to direction and back.
|
Detailed Description
A compass rose with a wind-direction arrow.
Member Enumeration Documentation
Constructor & Destructor Documentation
| makVrv::DtWindDirectionDialWidget::DtWindDirectionDialWidget |
( |
QWidget * |
parent = NULL | ) |
|
CTOR.
- Parameters
-
| [in] | parent | is the parent to manage this widget. |
| virtual makVrv::DtWindDirectionDialWidget::~DtWindDirectionDialWidget |
( |
| ) |
|
|
virtual |
Member Function Documentation
| virtual void makVrv::DtWindDirectionDialWidget::setBackGround |
( |
BackGroundType |
type | ) |
|
|
virtual |
Set the background for the compass.
- Parameters
-
| [in] | type | is the type of background, default TICKS. |
| virtual BackGroundType makVrv::DtWindDirectionDialWidget::backGround |
( |
| ) |
const |
|
virtual |
Get the background for the compass.
- Returns
- the type of background.
| virtual void makVrv::DtWindDirectionDialWidget::setNeedle |
( |
NeedleType |
type | ) |
|
|
virtual |
Set the needle for the compass.
- Parameters
-
| [in] | type | is the type of needle, default ARROW. |
| virtual NeedleType makVrv::DtWindDirectionDialWidget::needle |
( |
| ) |
const |
|
virtual |
Get the needle for the compass.
- Returns
- the type of needle.
| int makVrv::DtWindDirectionDialWidget::direction |
( |
| ) |
const |
Get the direction.
- Returns
- the direction.
- Note
- Converts the base class value to direction (180 degree change).
| double makVrv::DtWindDirectionDialWidget::directionF |
( |
| ) |
const |
Get the direction as a double value.
- Returns
- the direction.
- Note
- Converts the base class value to direction (180 degree change).
| void makVrv::DtWindDirectionDialWidget::directionChanged |
( |
int |
| ) |
|
|
signal |
Signal emitted when the direction changed.
| void makVrv::DtWindDirectionDialWidget::directionChanged |
( |
double |
| ) |
|
|
signal |
Signal emitted when the direction changed.
| void makVrv::DtWindDirectionDialWidget::setDirection |
( |
int |
degrees | ) |
|
|
slot |
Set the direction.
- Parameters
-
| [in] | degrees | is the new direction (wrapped to range 0-359). |
- Note
- Does not emit any signals.
| void makVrv::DtWindDirectionDialWidget::setDirection |
( |
double |
degrees | ) |
|
|
slot |
Set the direction as a double value.
- Parameters
-
| [in] | degrees | is the new direction (wrapped to range 0-359). |
- Note
- Does not emit any signals.
| void makVrv::DtWindDirectionDialWidget::onValueChanged |
( |
int |
val | ) |
|
|
protectedslot |
| virtual void makVrv::DtWindDirectionDialWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protectedvirtual |
Override the paint event to draw the widget.
- Parameters
-
| [in] | event | is the current paint event. |
| virtual void makVrv::DtWindDirectionDialWidget::resizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
protectedvirtual |
Override the resize event to change how the widget is displayed.
- Parameters
-
| [in] | event | is the resize event event. |
| virtual void makVrv::DtWindDirectionDialWidget::drawCompass |
( |
QPainter & |
painter, |
|
|
QRectF & |
rect |
|
) |
| |
|
protectedvirtual |
Utility function to draw the compass background.
- Parameters
-
| [in] | painter | is the painter to use for drawing. |
| [in] | rect | is the rectangular space to draw in. |
| virtual void makVrv::DtWindDirectionDialWidget::drawCompassTick |
( |
QPainter & |
painter | ) |
|
|
protectedvirtual |
Utility function to draw the compass tick.
- Parameters
-
| [in] | painter | is the painter to use for drawing. |
| virtual void makVrv::DtWindDirectionDialWidget::drawHeadingNorth |
( |
QPainter & |
painter | ) |
|
|
protectedvirtual |
Utility function to draw the letter N.
- Parameters
-
| [in] | painter | is the painter to use for drawing. |
| virtual void makVrv::DtWindDirectionDialWidget::drawDirection |
( |
QPainter & |
painter, |
|
|
QRectF & |
rect |
|
) |
| |
|
protectedvirtual |
Utility function to draw the direction from.
- Parameters
-
| [in] | painter | is the painter to use for drawing. |
| [in] | rect | is the rectangular space to draw in. |
| virtual void makVrv::DtWindDirectionDialWidget::drawNeedle |
( |
QPainter & |
painter | ) |
|
|
protectedvirtual |
Utility function to draw the needle.
- Parameters
-
| [in] | painter | is the painter to use for drawing. |
| int makVrv::DtWindDirectionDialWidget::convert |
( |
int |
val | ) |
const |
|
private |
Utility to convert from base class value to direction and back.
- Parameters
-
| [in] | val | is value to convert. |
- Returns
- the converted value.
- Note
- Base class value is zero at bottom of dial, this conversion is used to make zero the top of the dial (North).
Member Data Documentation
| NeedleType makVrv::DtWindDirectionDialWidget::myNeedleType |
|
protected |
| double makVrv::DtWindDirectionDialWidget::myRemainder |
|
protected |
The documentation for this class was generated from the following file: