RangeSlider:
Filter:
Classes | GUI > Views

RangeSlider : QAbstractStepValue : AbstractStepValue : View : QObject : Object

A view consisting of a sliding extendable handle
Subclasses: QRangeSlider

Description

A view that allows setting two numerical values between 0 and 1, represented by the two ends of a movable and extendable handle. It can have horizontal or vertical orientation, meaning the direction in which the handle moves and extends.

Dragging the mouse pointer on either end of the range moves the end by itself. Dragging in the middle of the range moves the whole range without changing its size.

Class Methods

RangeSlider.new(parent, bounds)

When a new RangeSlider is created, its -orientation is determined by the initial size: if it is wider than high, the orientation will be horizontal, otherwise it will be vertical.

Inherited class methods

Undocumented class methods

RangeSlider.qtClass

Instance Methods

Data

.lo

.lo = aFloat

The low end of the range.

If you attempt to set it higher then the current -hi, -hi will be set instead, and -lo will become the old -hi.

When setting -lo the value will always be clipped to the range between 0 and 1.

Arguments:

aFloat

A Float between 0 and 1.

.hi

.hi = aFloat

The high end of the range. If you attempt to set it lower then the current -lo, -lo will be set instead, and -hi will become the old -lo.

When setting -hi the value will always be clipped to the range between 0 and 1.

Arguments:

aFloat

A Float between 0 and 1.

.activeLo = aFloat

Sets -lo to the argument and triggers -action.

.activeHi = aFloat

Sets -hi to the argument and triggers -action.

.range

.range = aFloat

The difference between -hi and -lo. Setting -range will set -hi to -lo + -range.

.activeRange = aFloat

Sets -range to the argument and triggers -action.

.setSpan(lo, hi)

Sets -lo and -hi to each of the arguments, respectively.

.setSpanActive(lo, hi)

Calls -setSpan, forwarding the arguments, and triggers -action.

.setDeviation(deviation, average)

Sets -lo and -hi according to their deviation and their average instead of their absolute values.

Arguments:

deviation

A Float determining the absolute deviation of -lo and -hi from their average.

average

A Float determining the average of -lo and -hi.

.increment(factor: 1.0)

From superclass: AbstractStepValue

Increments both -lo and -hi by -step multiplied by 'factor'.

Arguments:

factor

A Float.

.decrement(factor: 1.0)

From superclass: AbstractStepValue

Decrements both -lo and -hi by -step multiplied by 'factor'.

Arguments:

factor

A Float.

Appearance

.orientation = aSymbol

The orientation of the RangeSlider - the direction in which the handle moves and is extendable. The default value depends on the size of the view when created.

Arguments:

aSymbol

One of the two Symbols: \horizontal or \vertical.

.knobColor

.knobColor = color

The color of the handle.

Arguments:

color

A Color.

Interaction

.step

.step = aFloat

From superclass: AbstractStepValue

The amount by which the range will change when -increment or -decrement is called, or when related keys are pressed.

Arguments:

aFloat

A Float.

.pixelStep

The absolute amount by which the range would change if the handle moved by one pixel.

Returns:

A Float.

.shift_scale

.shift_scale = aFloat

From superclass: AbstractStepValue

The factor by which -step is multiplied when incrementing or decrementing the range by keyboard while the Shift key is pressed.

Arguments:

aFloat

A Float.

.ctrl_scale

.ctrl_scale = aFloat

From superclass: AbstractStepValue

The factor by which -step is multiplied when incrementing or decrementing the range by keyboard while the Ctrl key is pressed.

Arguments:

aFloat

A Float.

.alt_scale

.alt_scale = aFloat

From superclass: AbstractStepValue

The factor by which -step is multiplied when incrementing or decrementing the range by keyboard while the Alt key is pressed.

Arguments:

aFloat

A Float.

Actions

.action

.action = func

From superclass: View

The action object evaluated whenever the user changes the position or size of the handle.

.defaultKeyDownAction(char, modifiers, unicode, keycode, key)

From superclass: View

Implements the default effects of key presses as follows:

KeyEffect
alo_(0), hi_(1), and triggers action
nlo_(0), hi_(0), and triggers action
xlo_(1), hi_(1), and triggers action
clo_(0.5), hi_(0.5), and triggers action
up arrowincrement
down arrowdecrement
right arrowincrement
left arrowdecrement

Drag and drop

.defaultGetDrag

Returns:

A Point of which the x and y coordinates are set to -lo and -hi, respectively.

.defaultCanReceiveDrag

Returns:

True if the current drag data is a Point.

.defaultReceiveDrag

Sets -lo and -hi to the two coordinates of the Point stored as the current drag data, respectively, and triggers the -action.

Inherited instance methods

Undocumented instance methods

.background

.background = color

.initQRangeSlider(bounds)

Examples

Basic examples

Use of setDeviation

Sound example

Shape a bandpass filter.

In Cocoa GUI, hold down the Ctrl key to move the whole range; in other GUI kits you can simply click within the range and drag it.