VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Slots | Signals | Public Member Functions | Protected Attributes | Private Member Functions
makVrv::DtWindDirectionWidget Class Reference

A widget for pairing a wind direction dial with a combo box. More...

Inheritance diagram for makVrv::DtWindDirectionWidget:
Inheritance graph
[legend]

Public Slots

void setDirection (int degrees)
 Set the direction.
void setDirection (double degrees)
 Set the direction as a double value.
void setCardinalDirection (const QString &dir)
 Set the cardinal direction.

Signals

void directionChanged (int)
 Signal emitted when the direction changed.
void directionChanged (double)
 Signal emitted when the direction changed.
void cardinalDirectionChanged (QString)
 Signal emitted when the cardinal direction changed.

Public Member Functions

 DtWindDirectionWidget (QWidget *parent=NULL, Qt::WindowFlags flags=Qt::Widget)
 CTOR.
virtual ~DtWindDirectionWidget ()
 virtual DTOR
Field value setters.

Sets the values of the widget's corresponding fields.

int direction () const
 Get the direction.
double directionF () const
 Get the direction as a double value.
QString cardinalDirection () const
 Get the cardinal direction.
Accessors to the underlying widgets.

Gets the handle to each of the child widgets.

QHBoxLayout * mainLayout ()
 Get the main layout for this widget.
DtWindDirectionDialWidgetcompassDialWidget ()
 Get the compass-dial for this widget.
QComboBoxcomboboxWidget ()
 Get the combo-box for this widget.

Protected Slots

User input slots.

Slots connected to the signals of the internal widgets.

virtual void onDialDirectionChanged (double value)
virtual void onComboBoxIndexChanged (const QString &text)

Protected Member Functions

Event handlers.

Extending base-class event handlers to propagate to children.

virtual void changeEvent (QEvent *evt)
 Handle the enabled/disabled event.
virtual void showEvent (QShowEvent *evt)
virtual void hideEvent (QHideEvent *evt)
 Handle the enabled/disabled event.

Protected Attributes

QHBoxLayout * myLayout
DtWindDirectionDialWidgetmyDial
QComboBoxmyComboBox
QStringList myCardinalDirections
QList< double > myCardinalBounds

Private Member Functions

void setupGui ()
 Sets up the widget's fields.
void connectToSignals ()
 Connects widget signals to slots.
QString makeCardinal (double dir) const
 Utility function to transform a direction into a cardinal value.
double makeDegrees (const QString &dir) const
 Utility function to transform a cardinal value into a direction.

Detailed Description

A widget for pairing a wind direction dial with a combo box.

The wind direction dial shows the wind direction and the combo box names the cardinal direction (N, E, S, W, etc).

Constructor & Destructor Documentation

makVrv::DtWindDirectionWidget::DtWindDirectionWidget ( QWidget parent = NULL,
Qt::WindowFlags  flags = Qt::Widget 
)

CTOR.

Parameters
[in]parentis the parent to manage this widget.
[in]flagsis a set of windowing flags for display.
virtual makVrv::DtWindDirectionWidget::~DtWindDirectionWidget ( )
virtual

virtual DTOR

Member Function Documentation

int makVrv::DtWindDirectionWidget::direction ( ) const

Get the direction.

Returns
the direction as an integer (in degrees).
double makVrv::DtWindDirectionWidget::directionF ( ) const

Get the direction as a double value.

Returns
the direction as a double (in degrees).
QString makVrv::DtWindDirectionWidget::cardinalDirection ( ) const

Get the cardinal direction.

Returns
the nearest matched cardinal direction).
QHBoxLayout* makVrv::DtWindDirectionWidget::mainLayout ( )

Get the main layout for this widget.

returns a handle to the main layout.

DtWindDirectionDialWidget* makVrv::DtWindDirectionWidget::compassDialWidget ( )

Get the compass-dial for this widget.

returns a handle to the compass-dial.

QComboBox* makVrv::DtWindDirectionWidget::comboboxWidget ( )

Get the combo-box for this widget.

returns a handle to the combo-box.

void makVrv::DtWindDirectionWidget::directionChanged ( int  )
signal

Signal emitted when the direction changed.

void makVrv::DtWindDirectionWidget::directionChanged ( double  )
signal

Signal emitted when the direction changed.

void makVrv::DtWindDirectionWidget::cardinalDirectionChanged ( QString  )
signal

Signal emitted when the cardinal direction changed.

void makVrv::DtWindDirectionWidget::setDirection ( int  degrees)
slot

Set the direction.

Parameters
[in]degreesis the new direction (wrapped to range 0-359).
Note
Does not emit any signals.
void makVrv::DtWindDirectionWidget::setDirection ( double  degrees)
slot

Set the direction as a double value.

Parameters
[in]degreesis the new direction (wrapped to range 0-359).
Note
Does not emit any signals.
void makVrv::DtWindDirectionWidget::setCardinalDirection ( const QString &  dir)
slot

Set the cardinal direction.

Parameters
[in]diris the new direction (N, NNE, NE, ENE, E, ESE, etc).
Note
Does not emit any signals.
virtual void makVrv::DtWindDirectionWidget::onDialDirectionChanged ( double  value)
protectedvirtualslot
virtual void makVrv::DtWindDirectionWidget::onComboBoxIndexChanged ( const QString &  text)
protectedvirtualslot
virtual void makVrv::DtWindDirectionWidget::changeEvent ( QEvent *  evt)
protectedvirtual

Handle the enabled/disabled event.

Parameters
[in]evtis the event to handle.
virtual void makVrv::DtWindDirectionWidget::showEvent ( QShowEvent *  evt)
protectedvirtual

Handle the show/hide events.

Parameters
[in]evtis the event to handle.
virtual void makVrv::DtWindDirectionWidget::hideEvent ( QHideEvent *  evt)
protectedvirtual

Handle the enabled/disabled event.

Parameters
[in]evtis the event to handle.
void makVrv::DtWindDirectionWidget::setupGui ( )
private

Sets up the widget's fields.

Non-virtual (Called from CTOR).

void makVrv::DtWindDirectionWidget::connectToSignals ( )
private

Connects widget signals to slots.

Non-virtual (Called from CTOR).

QString makVrv::DtWindDirectionWidget::makeCardinal ( double  dir) const
private

Utility function to transform a direction into a cardinal value.

Parameters
[in]diris the direction to transform.
Returns
the nearest matching cardinal value.
double makVrv::DtWindDirectionWidget::makeDegrees ( const QString &  dir) const
private

Utility function to transform a cardinal value into a direction.

Parameters
[in]diris the cardinal direction to transform.
Returns
the direction in degrees or 0.0 on translation failure.

Member Data Documentation

QHBoxLayout* makVrv::DtWindDirectionWidget::myLayout
protected
DtWindDirectionDialWidget* makVrv::DtWindDirectionWidget::myDial
protected
QComboBox* makVrv::DtWindDirectionWidget::myComboBox
protected
QStringList makVrv::DtWindDirectionWidget::myCardinalDirections
protected
QList<double> makVrv::DtWindDirectionWidget::myCardinalBounds
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)