ParaView
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkRangeSlider Class Reference

A ctkRangeSlider is a slider that lets you input 2 values instead of one (see QSlider). More...

#include <ctkRangeSlider.h>

Inherits QSlider.

Public Types

typedef QSlider Superclass
 

Public Slots

void setMinimumValue (int min)
 This property holds the slider's current minimum value. More...
 
void setMaximumValue (int max)
 This property holds the slider's current maximum value. More...
 
void setValues (int min, int max)
 Utility function that set the minimum value and maximum value at once. More...
 

Signals

void minimumValueChanged (int min)
 This signal is emitted when the slider minimum value has changed, with the new slider value as argument. More...
 
void maximumValueChanged (int max)
 This signal is emitted when the slider maximum value has changed, with the new slider value as argument. More...
 
void valuesChanged (int min, int max)
 Utility signal that is fired when minimum or maximum values have changed. More...
 
void minimumPositionChanged (int min)
 This signal is emitted when sliderDown is true and the slider moves. More...
 
void maximumPositionChanged (int max)
 This signal is emitted when sliderDown is true and the slider moves. More...
 
void positionsChanged (int min, int max)
 Utility signal that is fired when minimum or maximum positions have changed. More...
 

Public Member Functions

 ctkRangeSlider (Qt::Orientation o, QWidget *par=0)
 Constructor, builds a ctkRangeSlider 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. More...
 
 ctkRangeSlider (QWidget *par=0)
 
virtual ~ctkRangeSlider ()
 
int minimumValue () const
 This property holds the slider's current minimum value. More...
 
int maximumValue () const
 This property holds the slider's current maximum value. More...
 
int minimumPosition () const
 This property holds the current slider minimum position. More...
 
void setMinimumPosition (int min)
 
int maximumPosition () const
 This property holds the current slider maximum position. More...
 
void setMaximumPosition (int max)
 
void setPositions (int min, int max)
 Utility function that set the minimum position and maximum position at once. More...
 
bool symmetricMoves () const
 When symmetricMoves is true, moving a handle will move the other handle symmetrically, otherwise the handles are independent. More...
 
void setSymmetricMoves (bool symmetry)
 
QString handleToolTip () const
 Controls the text to display for the handle tooltip. More...
 
void setHandleToolTip (const QString &toolTip)
 

Protected Slots

void onRangeChanged (int minimum, int maximum)
 

Protected Member Functions

 ctkRangeSlider (ctkRangeSliderPrivate *impl, Qt::Orientation o, QWidget *par=0)
 
 ctkRangeSlider (ctkRangeSliderPrivate *impl, QWidget *par=0)
 
virtual void mousePressEvent (QMouseEvent *ev)
 
virtual void mouseMoveEvent (QMouseEvent *ev)
 
virtual void mouseReleaseEvent (QMouseEvent *ev)
 
virtual void mouseDoubleClickEvent (QMouseEvent *ev)
 
bool isMinimumSliderDown () const
 
bool isMaximumSliderDown () const
 
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< ctkRangeSliderPrivate > d_ptr
 

Properties

int minimumValue
 
int maximumValue
 
int minimumPosition
 
int maximumPosition
 
bool symmetricMoves
 
QString handleToolTip
 

Detailed Description

A ctkRangeSlider 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
ctkDoubleRangeSlider, ctkDoubleSlider, ctkRangeWidget

Definition at line 81 of file ctkRangeSlider.h.

Member Typedef Documentation

◆ Superclass

typedef QSlider ctkRangeSlider::Superclass

Definition at line 93 of file ctkRangeSlider.h.

Constructor & Destructor Documentation

◆ ctkRangeSlider() [1/4]

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

Constructor, builds a ctkRangeSlider 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.

◆ ctkRangeSlider() [2/4]

ctkRangeSlider::ctkRangeSlider ( QWidget *  par = 0)
explicit

◆ ~ctkRangeSlider()

virtual ctkRangeSlider::~ctkRangeSlider ( )
virtual

◆ ctkRangeSlider() [3/4]

ctkRangeSlider::ctkRangeSlider ( ctkRangeSliderPrivate *  impl,
Qt::Orientation  o,
QWidget *  par = 0 
)
protected

◆ ctkRangeSlider() [4/4]

ctkRangeSlider::ctkRangeSlider ( ctkRangeSliderPrivate *  impl,
QWidget *  par = 0 
)
protected

Member Function Documentation

◆ minimumValue()

int ctkRangeSlider::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.

◆ maximumValue()

int ctkRangeSlider::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.

◆ minimumPosition()

int ctkRangeSlider::minimumPosition ( ) const

This property holds the current slider minimum position.

If tracking is enabled (the default), this is identical to minimumValue.

◆ setMinimumPosition()

void ctkRangeSlider::setMinimumPosition ( int  min)

◆ maximumPosition()

int ctkRangeSlider::maximumPosition ( ) const

This property holds the current slider maximum position.

If tracking is enabled (the default), this is identical to maximumValue.

◆ setMaximumPosition()

void ctkRangeSlider::setMaximumPosition ( int  max)

◆ setPositions()

void ctkRangeSlider::setPositions ( int  min,
int  max 
)

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

◆ symmetricMoves()

bool ctkRangeSlider::symmetricMoves ( ) const

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

False by default

◆ setSymmetricMoves()

void ctkRangeSlider::setSymmetricMoves ( bool  symmetry)

◆ handleToolTip()

QString ctkRangeSlider::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.

◆ setHandleToolTip()

void ctkRangeSlider::setHandleToolTip ( const QString &  toolTip)

◆ minimumValueChanged

void ctkRangeSlider::minimumValueChanged ( int  min)
signal

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

◆ maximumValueChanged

void ctkRangeSlider::maximumValueChanged ( int  max)
signal

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

◆ valuesChanged

void ctkRangeSlider::valuesChanged ( int  min,
int  max 
)
signal

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

◆ minimumPositionChanged

void ctkRangeSlider::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.

◆ maximumPositionChanged

void ctkRangeSlider::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.

◆ positionsChanged

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

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

◆ setMinimumValue

void ctkRangeSlider::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

◆ setMaximumValue

void ctkRangeSlider::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

◆ setValues

void ctkRangeSlider::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

◆ onRangeChanged

void ctkRangeSlider::onRangeChanged ( int  minimum,
int  maximum 
)
protectedslot

◆ mousePressEvent()

virtual void ctkRangeSlider::mousePressEvent ( QMouseEvent *  ev)
protectedvirtual

◆ mouseMoveEvent()

virtual void ctkRangeSlider::mouseMoveEvent ( QMouseEvent *  ev)
protectedvirtual

◆ mouseReleaseEvent()

virtual void ctkRangeSlider::mouseReleaseEvent ( QMouseEvent *  ev)
protectedvirtual

◆ mouseDoubleClickEvent()

virtual void ctkRangeSlider::mouseDoubleClickEvent ( QMouseEvent *  ev)
protectedvirtual

◆ isMinimumSliderDown()

bool ctkRangeSlider::isMinimumSliderDown ( ) const
protected

◆ isMaximumSliderDown()

bool ctkRangeSlider::isMaximumSliderDown ( ) const
protected

◆ paintEvent()

virtual void ctkRangeSlider::paintEvent ( QPaintEvent *  ev)
protectedvirtual

◆ initMinimumSliderStyleOption()

virtual void ctkRangeSlider::initMinimumSliderStyleOption ( QStyleOptionSlider *  option) const
protectedvirtual

◆ initMaximumSliderStyleOption()

virtual void ctkRangeSlider::initMaximumSliderStyleOption ( QStyleOptionSlider *  option) const
protectedvirtual

◆ event()

virtual bool ctkRangeSlider::event ( QEvent *  event)
protectedvirtual

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkRangeSliderPrivate> ctkRangeSlider::d_ptr
protected

Definition at line 266 of file ctkRangeSlider.h.

Property Documentation

◆ minimumValue

int ctkRangeSlider::minimumValue
readwrite

Definition at line 84 of file ctkRangeSlider.h.

◆ maximumValue

int ctkRangeSlider::maximumValue
readwrite

Definition at line 85 of file ctkRangeSlider.h.

◆ minimumPosition

int ctkRangeSlider::minimumPosition
readwrite

Definition at line 86 of file ctkRangeSlider.h.

◆ maximumPosition

int ctkRangeSlider::maximumPosition
readwrite

Definition at line 87 of file ctkRangeSlider.h.

◆ symmetricMoves

bool ctkRangeSlider::symmetricMoves
readwrite

Definition at line 88 of file ctkRangeSlider.h.

◆ handleToolTip

QString ctkRangeSlider::handleToolTip
readwrite

Definition at line 89 of file ctkRangeSlider.h.


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