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

A widget for pairing a horizontal slider with a double spin-box. More...

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

Public Types

enum  SliderScale { LINEAR, LOGARITHMIC }

Signals

void valueChanged (double value)
 Signal when the value has changed by either the slider or spinbox.

Public Member Functions

 DtSliderDoubleSpinboxWidget (double maxValue, double minValue=0, QWidget *parent=NULL, Qt::WindowFlags flags=Qt::Widget)
 CTOR.
 DtSliderDoubleSpinboxWidget (QWidget *parent=0, Qt::WindowFlags flags=Qt::Widget)
 CTOR for use with UI files.
virtual ~DtSliderDoubleSpinboxWidget ()
 virtual DTOR
Field value setters.

Sets the values of the widget's corresponding fields.

virtual void setValue (double value)
 Set the current value.
virtual double value () const
 Get the current value.
virtual void setMaxAndMin (double maxValue, double minValue)
 Set the maximum and minimum values.
virtual double maximum () const
 Get the maximum allowed value for this widget.
virtual double minimum () const
 Get the minimum allowed value for this widget.
virtual void setSingleStep (double step)
 Set the single step value.
virtual double singleStep () const
 Get the single step value for this widget.
virtual void setSliderScale (SliderScale scale)
 Set the slider scale type.
virtual SliderScale setSliderScale () const
 Get the slider scale type.
virtual void setSliderRange (int range)
 Set the slider range.
virtual int sliderRange () const
 Get the slider range.
Accessors to the underlying widgets.

Gets the handle to each of the child widgets.

QHBoxLayout * mainLayout ()
 Get the main layout for this widget.
QSlider * sliderWidget ()
 Get the slider for this widget.
QDoubleSpinBox * spinboxWidget ()
 Get the spin-box for this widget.

Protected Slots

User input slots.

Slots connected to the signals of the internal widgets.

virtual void onSliderValueChanged (int value)
virtual void onSpinnerValueChanged (double value)

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)

Protected Attributes

QHBoxLayout * myLayout
QSlider * mySlider
QDoubleSpinBox * mySpinBox
double myMaximum
double myMinimum
SliderScale mySliderScale
double myScaleFactor

Private Member Functions

void setupGui ()
 Sets up the widget's fields.
void connectToSignals ()
 Connects widget signals to slots.
virtual int makeInteger (double value)
 Helper function to convert spin-box double to slider int value.
virtual double makeDouble (int value)
 Helper function to convert slider int to spin-box double value.

Detailed Description

A widget for pairing a horizontal slider with a double spin-box.

The spin box must be clamped to a min and max value, as the slider cannot slide continuously.

Member Enumeration Documentation

Enumerator:
LINEAR 
LOGARITHMIC 

Constructor & Destructor Documentation

makVrv::DtSliderDoubleSpinboxWidget::DtSliderDoubleSpinboxWidget ( double  maxValue,
double  minValue = 0,
QWidget *  parent = NULL,
Qt::WindowFlags  flags = Qt::Widget 
)

CTOR.

Parameters
[in]maxValueis the maximum allowed value for this widget.
[in]minValueis the minimum allowed value for this widget.
[in]parentis the parent to manage this widget.
[in]flagsis a set of windowing flags for display.
makVrv::DtSliderDoubleSpinboxWidget::DtSliderDoubleSpinboxWidget ( QWidget *  parent = 0,
Qt::WindowFlags  flags = Qt::Widget 
)

CTOR for use with UI files.

Parameters
[in]parentis the parent to manage this widget.
virtual makVrv::DtSliderDoubleSpinboxWidget::~DtSliderDoubleSpinboxWidget ( )
virtual

virtual DTOR

Member Function Documentation

virtual void makVrv::DtSliderDoubleSpinboxWidget::setValue ( double  value)
virtual

Set the current value.

Parameters
[in]valueis the new value to set.
Note
The value will be clamped between max and min.
virtual double makVrv::DtSliderDoubleSpinboxWidget::value ( ) const
virtual

Get the current value.

Returns
the current value.
virtual void makVrv::DtSliderDoubleSpinboxWidget::setMaxAndMin ( double  maxValue,
double  minValue 
)
virtual

Set the maximum and minimum values.

Parameters
[in]maxValueis the maximum allowed value for this widget.
[in]minValueis the minimum allowed value for this widget.
virtual double makVrv::DtSliderDoubleSpinboxWidget::maximum ( ) const
virtual

Get the maximum allowed value for this widget.

virtual double makVrv::DtSliderDoubleSpinboxWidget::minimum ( ) const
virtual

Get the minimum allowed value for this widget.

virtual void makVrv::DtSliderDoubleSpinboxWidget::setSingleStep ( double  step)
virtual

Set the single step value.

Parameters
[in]stepis the single step value through the range.
virtual double makVrv::DtSliderDoubleSpinboxWidget::singleStep ( ) const
virtual

Get the single step value for this widget.

virtual void makVrv::DtSliderDoubleSpinboxWidget::setSliderScale ( SliderScale  scale)
virtual

Set the slider scale type.

Parameters
[in]scaleis the slider scale (default LINEAR).
virtual SliderScale makVrv::DtSliderDoubleSpinboxWidget::setSliderScale ( ) const
virtual

Get the slider scale type.

Returns
the current slider scale.
virtual void makVrv::DtSliderDoubleSpinboxWidget::setSliderRange ( int  range)
virtual

Set the slider range.

Parameters
[in]rangeis the slider range Default is 100 for linear and 10000 for logarithmic. Note that calling setSliderScale() will reset the range to the default values
virtual int makVrv::DtSliderDoubleSpinboxWidget::sliderRange ( ) const
virtual

Get the slider range.

Returns
the slider range
QHBoxLayout* makVrv::DtSliderDoubleSpinboxWidget::mainLayout ( )

Get the main layout for this widget.

returns a handle to the main layout.

QSlider* makVrv::DtSliderDoubleSpinboxWidget::sliderWidget ( )

Get the slider for this widget.

returns a handle to the slider.

QDoubleSpinBox* makVrv::DtSliderDoubleSpinboxWidget::spinboxWidget ( )

Get the spin-box for this widget.

returns a handle to the spin-box.

void makVrv::DtSliderDoubleSpinboxWidget::valueChanged ( double  value)
signal

Signal when the value has changed by either the slider or spinbox.

Parameters
[in]valueis the new current value.
virtual void makVrv::DtSliderDoubleSpinboxWidget::onSliderValueChanged ( int  value)
protectedvirtualslot
virtual void makVrv::DtSliderDoubleSpinboxWidget::onSpinnerValueChanged ( double  value)
protectedvirtualslot
virtual void makVrv::DtSliderDoubleSpinboxWidget::changeEvent ( QEvent *  evt)
protectedvirtual

Handle the enabled/disabled event.

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

Handle the show/hide events.

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

Sets up the widget's fields.

Non-virtual (Called from CTOR).

void makVrv::DtSliderDoubleSpinboxWidget::connectToSignals ( )
private

Connects widget signals to slots.

Non-virtual (Called from CTOR).

virtual int makVrv::DtSliderDoubleSpinboxWidget::makeInteger ( double  value)
privatevirtual

Helper function to convert spin-box double to slider int value.

virtual double makVrv::DtSliderDoubleSpinboxWidget::makeDouble ( int  value)
privatevirtual

Helper function to convert slider int to spin-box double value.

Member Data Documentation

QHBoxLayout* makVrv::DtSliderDoubleSpinboxWidget::myLayout
protected
QSlider* makVrv::DtSliderDoubleSpinboxWidget::mySlider
protected
QDoubleSpinBox* makVrv::DtSliderDoubleSpinboxWidget::mySpinBox
protected
double makVrv::DtSliderDoubleSpinboxWidget::myMaximum
protected
double makVrv::DtSliderDoubleSpinboxWidget::myMinimum
protected
SliderScale makVrv::DtSliderDoubleSpinboxWidget::mySliderScale
protected
double makVrv::DtSliderDoubleSpinboxWidget::myScaleFactor
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)