Slider Class Reference

The Slider JavaScript class. A simplified version of the Slider Qt widget. More...

Public Slots

void valueChanged (int value)
 Sets the value in the slider, triggering the callback. More...
 

Properties

int value
 The value of the slider. More...
 
int minimum
 The minimum value of the slider. More...
 
int maximum
 The maximum value of the slider. More...
 
String orientation
 Whether or not the slider is horizontal or vertical. More...
 
String callback
 Use this to assign the name of another function. This function will be triggered automatically when the slider value is modified. More...
 

Detailed Description

The Slider JavaScript class. A simplified version of the Slider Qt widget.

var mySlider;
function sliderExample()
{
var myDialog = new Dialog();
myDialog.title = “Slider Example”;
var userInput = new Slider();
userInput.label = “Pick a number.”
userInput.minimum = -50;
userInput.maximum = 50;
userInput.value = 0;
userInput.orientation = “Vertical”;
//Whenever the valueChanged() signal is sent,
// the current value of the slider will be printed
userInput.callback = “printVal”;
mySlider = userInput;
myDialog.add( userInput );
myDialog.exec();
}
function printVal()
{
//This prints a continuous stream of updating values, as they are changed
MessageLog.trace(mySlider.value);
}

Member Function Documentation

◆ valueChanged

void Slider::valueChanged ( int  value)
slot

Sets the value in the slider, triggering the callback.

Property Documentation

◆ callback

String Slider::callback
readwrite

Use this to assign the name of another function. This function will be triggered automatically when the slider value is modified.

◆ maximum

int Slider::maximum
readwrite

The maximum value of the slider.

◆ minimum

int Slider::minimum
readwrite

The minimum value of the slider.

◆ orientation

String Slider::orientation
readwrite

Whether or not the slider is horizontal or vertical.

◆ value

int Slider::value
readwrite

The value of the slider.