#include <universalslider.h>
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. |
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.
CUniversalSlider::CUniversalSlider | ( | const QString & | componentName = QString() |
) |
Constructs a slider object with a given name.
componentName | Name of the value to edit. |
void CUniversalSlider::setContentBool | ( | bool | value | ) |
Sets the slider to boolean type.
Boolean types range only from 0 (false) tp 1 (true).
value | Initial slider value. |
void CUniversalSlider::setContentInt | ( | int | minimum, | |
int | maximum, | |||
int | value | |||
) |
Sets the slider to integer type.
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.
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.
int CUniversalSlider::getContentInt | ( | void | ) |
Get the current value as integer.
double CUniversalSlider::getContentFloat | ( | void | ) |
Get the current value as floating point.
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.