itom  4.1.0
RangeSlider Class Reference

#include <rangeSlider.h>

Inheritance diagram for RangeSlider:

Public Types

typedef QSlider Superclass
 

Public Slots

void setMinimumValue (int min)
 
void setMaximumValue (int max)
 
void setValues (int min, int max)
 

Signals

void minimumValueChanged (int min)
 
void maximumValueChanged (int max)
 
void valuesChanged (int min, int max)
 Utility signal that is fired when minimum or maximum values have changed.
 
void minimumPositionChanged (int min)
 
void maximumPositionChanged (int max)
 
void positionsChanged (int min, int max)
 

Public Member Functions

 RangeSlider (Qt::Orientation o, QWidget *par=0)
 
 RangeSlider (QWidget *par=0)
 
int minimumValue () const
 
int maximumValue () const
 
int minimumPosition () const
 
void setMinimumPosition (int min)
 
int maximumPosition () const
 
void setMaximumPosition (int max)
 
uint stepSizePosition () const
 
void setStepSizePosition (uint stepSize)
 
uint minimumRange () const
 
void setMinimumRange (uint min)
 
uint maximumRange () const
 
void setMaximumRange (uint max)
 
uint stepSizeRange () const
 
void setStepSizeRange (uint stepSize)
 
bool rangeIncludeLimits () const
 
void setRangeIncludeLimits (bool include)
 
void setPositions (int min, int max)
 
bool symmetricMoves () const
 
void setSymmetricMoves (bool symmetry)
 
bool useStyleSheets () const
 
void setUseStyleSheets (bool useStyleSheets)
 
float handleBorderRadius () const
 
void setHandleBorderRadius (float radius)
 
QString handleToolTip () const
 
void setHandleToolTip (const QString &toolTip)
 
bool isMinimumSliderDown () const
 
bool isMaximumSliderDown () const
 
void setLimitsFromIntervalMeta (const ito::IntervalMeta &intervalMeta)
 

Protected Slots

void onRangeChanged (int minimum, int maximum)
 

Protected Member Functions

 RangeSlider (RangeSliderPrivate *impl, Qt::Orientation o, QWidget *par=0)
 
 RangeSlider (RangeSliderPrivate *impl, QWidget *par=0)
 
virtual void mousePressEvent (QMouseEvent *ev)
 
virtual void mouseMoveEvent (QMouseEvent *ev)
 
virtual void mouseReleaseEvent (QMouseEvent *ev)
 
virtual void keyPressEvent (QKeyEvent *ev)
 
virtual void paintEvent (QPaintEvent *ev)
 
virtual void initMinimumSliderStyleOption (QStyleOptionSlider *option) const
 
virtual void initMaximumSliderStyleOption (QStyleOptionSlider *option) const
 
virtual bool event (QEvent *event)
 

Protected Attributes

QScopedPointer< RangeSliderPrivated_ptr
 

Properties

int minimumValue
 
int maximumValue
 
int minimumPosition
 
int maximumPosition
 
uint stepSizePosition
 
uint minimumRange
 
uint maximumRange
 
uint stepSizeRange
 
bool rangeIncludeLimits
 
bool symmetricMoves
 
QString handleToolTip
 
bool useStyleSheets
 
float handleBorderRadius
 

Private Member Functions

 Q_DECLARE_PRIVATE (RangeSlider)
 
 Q_DISABLE_COPY (RangeSlider)
 

Detailed Description

A RangeSlider is a slider that lets you input 2 values instead of one (see QSlider). These values are typically a lower and upper bound. Values are comprised between the range of the slider. See setRange(), minimum() and maximum(). The upper bound can't be smaller than the lower bound and vice-versa. When setting new values (setMinimumValue(), setMaximumValue() or setValues()), make sure they lie between the range (minimum(), maximum()) of the slider, they would be forced otherwised. If it is not the behavior you desire, you can set the range first (setRange(), setMinimum(), setMaximum()) TODO: support triggerAction(QAbstractSlider::SliderSingleStepSub) that moves both values at a time.

See also
DoubleRangeSlider, DoubleSlider, RangeWidget

Constructor & Destructor Documentation

RangeSlider::RangeSlider ( Qt::Orientation  o,
QWidget *  par = 0 
)
explicit

Constructor, builds a RangeSlider that ranges from 0 to 100 and has a lower and upper values of 0 and 100 respectively, other properties are set the QSlider default properties.

Member Function Documentation

float RangeSlider::handleBorderRadius ( ) const

When useStyleSheets is enabled, the groove and handles are not rendered by the native style methods, but by special methods, that obtain colors from the current palette. This option should be enabled by style sheets, since the Qt QStyleSheetStyle is not able to properly render two handles and a colored groove.

QString RangeSlider::handleToolTip ( ) const

Controls the text to display for the handle tooltip. It is in addition to the widget tooltip. "%1" is replaced by the current value of the slider. Empty string (by default) means no tooltip.

bool RangeSlider::isMaximumSliderDown ( ) const

Returns true if the maximum value handle is down, false if it is up.

See also
isMinimumSliderDown()
bool RangeSlider::isMinimumSliderDown ( ) const

Returns true if the minimum value handle is down, false if it is up.

See also
isMaximumSliderDown()
int RangeSlider::maximumPosition ( ) const

This property holds the current slider maximum position. If tracking is enabled (the default), this is identical to maximumValue.

void RangeSlider::maximumPositionChanged ( int  max)
signal

This signal is emitted when sliderDown is true and the slider moves. This usually happens when the user is dragging the maximum slider. The value is the new slider maximum position. This signal is emitted even when tracking is turned off.

uint RangeSlider::maximumRange ( ) const

This property holds the maximum allowed range. The range is (1+maximumRange-minimumRange) if rangeIncludeLimits is true, else (maximumRange-minimumRange)

int RangeSlider::maximumValue ( ) const

This property holds the slider's current maximum value. The slider forces the maximum value to be within the legal range: The slider silently forces maximumValue to be within the legal range: Changing the maximumValue also changes the maximumPosition.

void RangeSlider::maximumValueChanged ( int  max)
signal

This signal is emitted when the slider maximum value has changed, with the new slider value as argument.

int RangeSlider::minimumPosition ( ) const

This property holds the current slider minimum position. If tracking is enabled (the default), this is identical to minimumValue.

void RangeSlider::minimumPositionChanged ( int  min)
signal

This signal is emitted when sliderDown is true and the slider moves. This usually happens when the user is dragging the minimum slider. The value is the new slider minimum position. This signal is emitted even when tracking is turned off.

uint RangeSlider::minimumRange ( ) const

This property holds the minimum allowed range. The range is (1+maximumRange-minimumRange) if rangeIncludeLimits is true, else (maximumRange-minimumRange)

int RangeSlider::minimumValue ( ) const

This property holds the slider's current minimum value. The slider silently forces minimumValue to be within the legal range: minimum() <= minimumValue() <= maximumValue() <= maximum(). Changing the minimumValue also changes the minimumPosition.

void RangeSlider::minimumValueChanged ( int  min)
signal

This signal is emitted when the slider minimum value has changed, with the new slider value as argument.

void RangeSlider::positionsChanged ( int  min,
int  max 
)
signal

Utility signal that is fired when minimum or maximum positions have changed.

bool RangeSlider::rangeIncludeLimits ( ) const

This property indicates if the range is assumed to be (1+maximumRange-minimumRange) (true) or (maximumRange-minimumRange) (false). The first case is important if the rangeSlider is used for ROIs of cameras, where the first and last value are inside of the ROI.

void RangeSlider::setLimitsFromIntervalMeta ( const ito::IntervalMeta intervalMeta)

The range slider can be used for parameters whose meta data is of type ito::IntervalMeta or ito::RangeMeta. In this case, the limits, step sizes... of this rangeSlider can be automatically adapted to the requirements given by the corresponding parameter.

void RangeSlider::setMaximumValue ( int  max)
slot

This property holds the slider's current maximum value. The slider silently forces max to be within the legal range: minimum() <= minimumValue() <= max <= maximum(). Note: Changing the maximumValue also changes the maximumPosition.

See also
stMinimumValue, setValues, setMinimum, setMaximum, setRange
void RangeSlider::setMinimumValue ( int  min)
slot

This property holds the slider's current minimum value. The slider silently forces min to be within the legal range: minimum() <= min <= maximumValue() <= maximum(). Note: Changing the minimumValue also changes the minimumPosition.

See also
stMaximumValue, setValues, setMinimum, setMaximum, setRange
void RangeSlider::setPositions ( int  min,
int  max 
)

Utility function that set the minimum position and maximum position at once.

void RangeSlider::setValues ( int  min,
int  max 
)
slot

Utility function that set the minimum value and maximum value at once. The slider silently forces min and max to be within the legal range: minimum() <= min <= max <= maximum(). Note: Changing the minimumValue and maximumValue also changes the minimumPosition and maximumPosition.

See also
setMinimumValue, setMaximumValue, setMinimum, setMaximum, setRange
uint RangeSlider::stepSizePosition ( ) const

This property holds the step size for the left or right slider position. If the stepSize is equal to 1, this property has no impact.

uint RangeSlider::stepSizeRange ( ) const

This property holds the step size of the allowed range. The range is (1+maximumRange-minimumRange) if rangeIncludeLimits is true, else (maximumRange-minimumRange)

bool RangeSlider::symmetricMoves ( ) const

When symmetricMoves is true, moving a handle will move the other handle symmetrically, otherwise the handles are independent. False by default

bool RangeSlider::useStyleSheets ( ) const

When useStyleSheets is enabled, the groove and handles are not rendered by the native style methods, but by special methods, that obtain colors from the current palette. This option should be enabled by style sheets, since the Qt QStyleSheetStyle is not able to properly render two handles and a colored groove.


The documentation for this class was generated from the following files: