CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Attributes | Properties | List of all members
ctkDoubleSlider Class Reference

#include <Libs/Widgets/ctkDoubleSlider.h>

Inheritance diagram for ctkDoubleSlider:
Inheritance graph
[legend]
Collaboration diagram for ctkDoubleSlider:
Collaboration graph
[legend]

Public Types

typedef QWidget Superclass
 Superclass typedef. More...
 

Public Slots

void setOrientation (Qt::Orientation orientation)
 
void setValue (double value)
 

Signals

void rangeChanged (double min, double max)
 
void sliderMoved (double position)
 
void sliderPressed ()
 
void sliderReleased ()
 
void valueChanged (double value)
 

Public Member Functions

 ctkDoubleSlider (Qt::Orientation orient, QWidget *parent=0)
 
 ctkDoubleSlider (QWidget *parent=0)
 
virtual bool eventFilter (QObject *, QEvent *)
 Reimplemented for internal reasons (handle tooltip). More...
 
QString handleToolTip () const
 
bool hasTracking () const
 
bool invertedAppearance () const
 
bool invertedControls () const
 
bool isValidStep (double step) const
 
double maximum () const
 
double minimum () const
 
Qt::Orientation orientation () const
 
double pageStep () const
 
void setHandleToolTip (const QString &toolTip)
 
void setInvertedAppearance (bool invertedAppearance)
 
void setInvertedControls (bool invertedControls)
 
void setMaximum (double max)
 
void setMinimum (double min)
 
void setPageStep (double step)
 
void setRange (double min, double max)
 
void setSingleStep (double step)
 
void setSliderPosition (double)
 
void setTickInterval (double ti)
 
void setTickPosition (QSlider::TickPosition position)
 
void setTracking (bool enable)
 
void setValueProxy (ctkValueProxy *proxy)
 
double singleStep () const
 
QSlider * slider () const
 
double sliderPosition () const
 
double tickInterval () const
 
QSlider::TickPosition tickPosition () const
 
void triggerAction (QAbstractSlider::SliderAction action)
 
double value () const
 
ctkValueProxyvalueProxy () const
 
virtual ~ctkDoubleSlider ()
 Destructor. More...
 

Protected Slots

void onRangeChanged (int min, int max)
 
void onSliderMoved (int position)
 
void onValueChanged (int value)
 
void onValueProxyAboutToBeModified ()
 
void onValueProxyModified ()
 

Protected Attributes

QScopedPointer< ctkDoubleSliderPrivate > d_ptr
 

Properties

QString handleToolTip
 
bool invertedAppearance
 
bool invertedControls
 
double maximum
 
double minimum
 
Qt::Orientation orientation
 
double pageStep
 
double singleStep
 
double sliderPosition
 
double tickInterval
 
QSlider::TickPosition tickPosition
 
bool tracking
 
double value
 

Detailed Description

ctkDoubleSlider is a QSlider that controls doubles instead of integers. ctkDoubleSlider internally aggregates a QSlider TODO: ctkDoubleSlider tries to represent a double value with integers. It's of course non-optimal and can lead to errors, it would be better if ctkDoubleSlider works like QDoubleSpinBox, where the value is a QVariant and the conversion between double and integer is only done to convert to/from screen coordinates.

See also
ctkRangeSlider, ctkDoubleRangeSlider, ctkRangeWidget

Definition at line 44 of file ctkDoubleSlider.h.

Member Typedef Documentation

◆ Superclass

typedef QWidget ctkDoubleSlider::Superclass

Superclass typedef.

Definition at line 63 of file ctkDoubleSlider.h.

Constructor & Destructor Documentation

◆ ctkDoubleSlider() [1/2]

ctkDoubleSlider::ctkDoubleSlider ( QWidget *  parent = 0)
explicit

Constructors, builds a slider whose default values are the same as QSlider (vertical by default).

◆ ctkDoubleSlider() [2/2]

ctkDoubleSlider::ctkDoubleSlider ( Qt::Orientation  orient,
QWidget *  parent = 0 
)
explicit

Constructors, builds a slider whose default values are the same as QSlider (vertical by default).

◆ ~ctkDoubleSlider()

virtual ctkDoubleSlider::~ctkDoubleSlider ( )
virtual

Destructor.

Member Function Documentation

◆ eventFilter()

virtual bool ctkDoubleSlider::eventFilter ( QObject *  ,
QEvent *   
)
virtual

Reimplemented for internal reasons (handle tooltip).

◆ handleToolTip()

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

◆ hasTracking()

bool ctkDoubleSlider::hasTracking ( ) const

◆ invertedAppearance()

bool ctkDoubleSlider::invertedAppearance ( ) const

◆ invertedControls()

bool ctkDoubleSlider::invertedControls ( ) const

◆ isValidStep()

bool ctkDoubleSlider::isValidStep ( double  step) const

Return true if the step can be handled by the slider, false otherwise. An invalid step is a step that can't be used to convert from double to int (too large or too small).

See also
singleStep

◆ maximum()

double ctkDoubleSlider::maximum ( ) const

◆ minimum()

double ctkDoubleSlider::minimum ( ) const

◆ onRangeChanged

void ctkDoubleSlider::onRangeChanged ( int  min,
int  max 
)
protectedslot

◆ onSliderMoved

void ctkDoubleSlider::onSliderMoved ( int  position)
protectedslot

◆ onValueChanged

void ctkDoubleSlider::onValueChanged ( int  value)
protectedslot

◆ onValueProxyAboutToBeModified

void ctkDoubleSlider::onValueProxyAboutToBeModified ( )
protectedslot

◆ onValueProxyModified

void ctkDoubleSlider::onValueProxyModified ( )
protectedslot

◆ orientation()

Qt::Orientation ctkDoubleSlider::orientation ( ) const

This property holds the orientation of the slider. The orientation must be Qt::Vertical (the default) or Qt::Horizontal.

◆ pageStep()

double ctkDoubleSlider::pageStep ( ) const

◆ rangeChanged

void ctkDoubleSlider::rangeChanged ( double  min,
double  max 
)
signal

This signal is emitted when the slider range has changed, with min being the new minimum, and max being the new maximum. Warning: don't confound with valuesChanged(double, double);

See also
QAbstractSlider::rangeChanged()

◆ setHandleToolTip()

void ctkDoubleSlider::setHandleToolTip ( const QString &  toolTip)

◆ setInvertedAppearance()

void ctkDoubleSlider::setInvertedAppearance ( bool  invertedAppearance)

This property holds whether or not a slider shows its values inverted. If this property is false (the default), the minimum and maximum will be shown in its classic position for the inherited widget. If the value is true, the minimum and maximum appear at their opposite location. Note: This property makes most sense for sliders and dials. For scroll bars, the visual effect of the scroll bar subcontrols depends on whether or not the styles understand inverted appearance; most styles ignore this property for scroll bars.

See also
invertedControls

◆ setInvertedControls()

void ctkDoubleSlider::setInvertedControls ( bool  invertedControls)

This property holds whether or not the slider inverts its wheel and key events. If this property is false, scrolling the mouse wheel "up" and using keys like page up will increase the slider's value towards its maximum. Otherwise pressing page up will move value towards the slider's minimum.

See also
invertedAppearance

◆ setMaximum()

void ctkDoubleSlider::setMaximum ( double  max)

This property holds the slider's maximum value. When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.

◆ setMinimum()

void ctkDoubleSlider::setMinimum ( double  min)

This property holds the sliders's minimum value. When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.

◆ setOrientation

void ctkDoubleSlider::setOrientation ( Qt::Orientation  orientation)
slot

This property holds the orientation of the slider. The orientation must be Qt::Vertical (the default) or Qt::Horizontal.

◆ setPageStep()

void ctkDoubleSlider::setPageStep ( double  step)

This property holds the page step. The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown. Default value is 10.

◆ setRange()

void ctkDoubleSlider::setRange ( double  min,
double  max 
)

Sets the slider's minimum to min and its maximum to max. If max is smaller than min, min becomes the only legal value.

◆ setSingleStep()

void ctkDoubleSlider::setSingleStep ( double  step)

This property holds the single step. The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key Default value is 1.

See also
isValidStep()

◆ setSliderPosition()

void ctkDoubleSlider::setSliderPosition ( double  )

◆ setTickInterval()

void ctkDoubleSlider::setTickInterval ( double  ti)

This property holds the interval between tickmarks. This is a value interval, not a pixel interval. If it is 0, the slider will choose between lineStep() and pageStep(). The default value is 0.

◆ setTickPosition()

void ctkDoubleSlider::setTickPosition ( QSlider::TickPosition  position)

This property holds the tickmark position for this slider. The valid values are described by the QSlider::TickPosition enum. The default value is QSlider::NoTicks.

◆ setTracking()

void ctkDoubleSlider::setTracking ( bool  enable)

This property holds whether slider tracking is enabled. If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.

◆ setValue

void ctkDoubleSlider::setValue ( double  value)
slot

This property holds the slider's current value. The slider forces the value to be within the legal range: minimum <= value <= maximum. Changing the value also changes the sliderPosition.

◆ setValueProxy()

void ctkDoubleSlider::setValueProxy ( ctkValueProxy proxy)

Install or remove a value proxy filter. The value proxy decouples the displayed value from the value retrieved by the value property. For example, the value proxy can allow one to display celsius in the spinbox while the value retrieved from the value property and signals are in farenheit. To remove the proxy, simply install a new empty proxy. The proxy installation/removal is silent.

See also
setValueProxy(), valueProxy()

◆ singleStep()

double ctkDoubleSlider::singleStep ( ) const

◆ slider()

QSlider* ctkDoubleSlider::slider ( ) const

Return a pointer to the QSlider used internally. Use with caution.

See also
QSlider

◆ sliderMoved

void ctkDoubleSlider::sliderMoved ( double  position)
signal

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

◆ sliderPosition()

double ctkDoubleSlider::sliderPosition ( ) const

This property holds the current slider position. If there is no proxy installed and tracking is enabled (the default), this is identical to value. With a proxy installed, it allows to modify the proxy value.

See also
value(), setValue(), setValueProxy(), valueProxy()

◆ sliderPressed

void ctkDoubleSlider::sliderPressed ( )
signal

This signal is emitted when the user presses the slider with the mouse, or programmatically when setSliderDown(true) is called.

◆ sliderReleased

void ctkDoubleSlider::sliderReleased ( )
signal

This signal is emitted when the user releases the slider with the mouse, or programmatically when setSliderDown(false) is called.

◆ tickInterval()

double ctkDoubleSlider::tickInterval ( ) const

◆ tickPosition()

QSlider::TickPosition ctkDoubleSlider::tickPosition ( ) const

◆ triggerAction()

void ctkDoubleSlider::triggerAction ( QAbstractSlider::SliderAction  action)

Triggers a slider action. Possible actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.

◆ value()

double ctkDoubleSlider::value ( ) const

This property holds the slider's current value. The slider forces the value to be within the legal range: minimum <= value <= maximum. Changing the value also changes the sliderPosition.

◆ valueChanged

void ctkDoubleSlider::valueChanged ( double  value)
signal

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

◆ valueProxy()

ctkValueProxy* ctkDoubleSlider::valueProxy ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkDoubleSliderPrivate> ctkDoubleSlider::d_ptr
protected

Definition at line 268 of file ctkDoubleSlider.h.

Property Documentation

◆ handleToolTip

QString ctkDoubleSlider::handleToolTip
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ invertedAppearance

bool ctkDoubleSlider::invertedAppearance
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ invertedControls

bool ctkDoubleSlider::invertedControls
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ maximum

double ctkDoubleSlider::maximum
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ minimum

double ctkDoubleSlider::minimum
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ orientation

Qt::Orientation ctkDoubleSlider::orientation
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ pageStep

double ctkDoubleSlider::pageStep
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ singleStep

double ctkDoubleSlider::singleStep
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ sliderPosition

double ctkDoubleSlider::sliderPosition
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ tickInterval

double ctkDoubleSlider::tickInterval
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ tickPosition

QSlider::TickPosition ctkDoubleSlider::tickPosition
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ tracking

bool ctkDoubleSlider::tracking
readwrite

Definition at line 1 of file ctkDoubleSlider.h.

◆ value

double ctkDoubleSlider::value
readwrite

Definition at line 1 of file ctkDoubleSlider.h.


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