CUniversalSlider Class Reference

A multi-type multi-editable slider widget. More...

#include <universalslider.h>

List of all members.

Signals

void contentsChanged (void)
 Emitted whenever the value of the slider changes.

Public Member Functions

 CUniversalSlider (const QString &componentName=QString())
 Constructs a slider object with a given name.
void setContentBool (bool value)
 Sets the slider to boolean type.
void setContentInt (int minimum, int maximum, int value)
 Sets the slider to integer type.
void setContentFloat (double minimum, double maximum, double value)
 Sets the slider to floating point type.
bool getContentBool (void)
 Get the current value as boolean.
int getContentInt (void)
 Get the current value as integer.
double getContentFloat (void)
 Get the current value as floating point.


Detailed Description

A multi-type multi-editable slider widget.

This widget can be used to edit values of different types with different/dynamic ranges in several way. It supports boolean, integer and floating point values. It provides a slider, which slides between a minimum and a maximum, which can be defined by the user. The values can also be changed directly with a spin box.

Warning:
Because QDoubleSpinBox uses doubles, but QSlider uses integers, there might appear some precision problems.

Constructor & Destructor Documentation

CUniversalSlider::CUniversalSlider ( const QString &  componentName = QString()  ) 

Constructs a slider object with a given name.

Parameters:
componentName Name of the value to edit.


Member Function Documentation

void CUniversalSlider::setContentBool ( bool  value  ) 

Sets the slider to boolean type.

Boolean types range only from 0 (false) tp 1 (true).

Parameters:
value Initial slider value.

void CUniversalSlider::setContentInt ( int  minimum,
int  maximum,
int  value 
)

Sets the slider to integer type.

Parameters:
value Initial slider value.
minimum Minimum slider value.
maximum Maximum slider value.

void CUniversalSlider::setContentFloat ( double  minimum,
double  maximum,
double  value 
)

Sets the slider to floating point type.

Parameters:
value Initial slider value.
minimum Minimum slider value.
maximum Maximum slider value.

bool CUniversalSlider::getContentBool ( void   ) 

Get the current value as boolean.

If the current type is not boolean, the current value is converted into false if <= 0 and true otherwise.

Returns:
The boolean value stored in the slider.

int CUniversalSlider::getContentInt ( void   ) 

Get the current value as integer.

Returns:
The integer value if the slider.

double CUniversalSlider::getContentFloat ( void   ) 

Get the current value as floating point.

Returns:
the floating point vlaue of the slider.

void CUniversalSlider::contentsChanged ( void   )  [signal]

Emitted whenever the value of the slider changes.

Becuase the slider can have different types, the notified object must query the slider value in the desired type by itself.

Warning:
It might happen, that this signal is emitted twice, when the user changes minimum or maximum values of the slider. This is caused by the rounding error prevention code.


The documentation for this class was generated from the following files:
Generated on Sun Mar 2 17:12:32 2008 for Shader Maker by  doxygen 1.5.4