VR-Forces 5.0.2 Developer's Guide
 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. The spin box must be clamped to a min and max value, as the slider cannot slide continuously.

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

Public Types

enum  SliderScale { LINEAR, LOGARITHMIC }
 

Signals

void valueChanged (double value)
 

Public Member Functions

 DtSliderDoubleSpinboxWidget (double maxValue, double minValue=0, QWidget *parent=NULL, Qt::WindowFlags flags=Qt::Widget)
 
 DtSliderDoubleSpinboxWidget (QWidget *parent=0, Qt::WindowFlags flags=Qt::Widget)
 
virtual ~DtSliderDoubleSpinboxWidget ()
 
Field value setters.

Sets the values of the widget's corresponding fields.

virtual void setValue (double value)
 
virtual double value () const
 
virtual void setDecimals (int decimalPlacesToUse)
 
virtual void setMaxAndMin (double maxValue, double minValue)
 
virtual double maximum () const
 
virtual double minimum () const
 
virtual void setSingleStep (double step)
 
virtual double singleStep () const
 
virtual void setSliderScale (SliderScale scale)
 
virtual SliderScale setSliderScale () const
 
virtual void setSliderRange (int range)
 
virtual int sliderRange () const
 
Accessors to the underlying widgets.

Gets the handle to each of the child widgets.

QHBoxLayout * mainLayout ()
 
QSlider * sliderWidget ()
 
QDoubleSpinBoxspinboxWidget ()
 

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)
 
virtual void showEvent (QShowEvent *evt)
 
virtual void hideEvent (QHideEvent *evt)
 

Protected Attributes

QHBoxLayout * myLayout
 
QSlider * mySlider
 
QDoubleSpinBoxmySpinBox
 
int myDecimals
 
double myMaximum
 
double myMinimum
 
SliderScale mySliderScale
 
double myScaleFactor
 

Private Member Functions

void setupGui ()
 
void connectToSignals ()
 
virtual int makeInteger (double value)
 
virtual double makeDouble (int value)
 

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::setDecimals ( int  decimalPlacesToUse)
virtual

Set the number of decimal places to use for the spinbox.

Parameters
[in]decimalPlacesToUseis the number of decimals places that will be used.
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

Handle the enabled/disabled event.

Parameters
[in]evtis the event to handle.
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
int makVrv::DtSliderDoubleSpinboxWidget::myDecimals
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)