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 Member Functions | Protected Attributes | Properties | List of all members
ctkSliderWidget Class Reference

#include <Libs/Widgets/ctkSliderWidget.h>

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

Public Types

typedef QWidget Superclass
 Superclass typedef. More...
 
enum  SynchronizeSibling { NoSynchronize = 0x000 , SynchronizeWidth = 0x001 , SynchronizeDecimals = 0x002 }
 

Public Slots

virtual void reset ()
 
virtual void setDecimals (int decimals)
 
virtual void setSpinBoxVisible (bool)
 
virtual void setValue (double value)
 

Signals

void decimalsChanged (int decimals)
 
void valueChanged (double value)
 
void valueIsChanging (double value)
 

Public Member Functions

 ctkSliderWidget (QWidget *parent=0)
 Constructors. More...
 
virtual int decimals () const
 
virtual bool hasPopupSlider () const
 
virtual bool hasTracking () const
 
virtual bool invertedAppearance () const
 
virtual bool invertedControls () const
 
virtual bool isSpinBoxVisible () const
 
virtual double maximum () const
 
virtual double minimum () const
 
virtual double pageStep () const
 
virtual ctkPopupWidgetpopup () const
 
virtual QString prefix () const
 
virtual void setInvertedAppearance (bool invertedAppearance)
 
virtual void setInvertedControls (bool invertedControls)
 
virtual void setMaximum (double maximum)
 
virtual void setMinimum (double minimum)
 
virtual void setPageStep (double step)
 
virtual void setPopupSlider (bool popup)
 
virtual void setPrefix (const QString &prefix)
 
virtual void setRange (double min, double max)
 
virtual void setSingleStep (double step)
 
virtual void setSpinBoxAlignment (Qt::Alignment alignment)
 
virtual void setSuffix (const QString &suffix)
 
virtual void setSynchronizeSiblings (ctkSliderWidget::SynchronizeSiblings options)
 
virtual void setTickInterval (double tick)
 
virtual void setTickPosition (QSlider::TickPosition position)
 
virtual void setTracking (bool enable)
 
virtual void setValueProxy (ctkValueProxy *proxy)
 
virtual double singleStep () const
 
virtual ctkDoubleSliderslider ()
 
virtual ctkDoubleSpinBoxspinBox ()
 
virtual Qt::Alignment spinBoxAlignment () const
 
virtual QString suffix () const
 
virtual ctkSliderWidget::SynchronizeSiblings synchronizeSiblings () const
 
virtual double tickInterval () const
 
virtual QSlider::TickPosition tickPosition () const
 
virtual double value () const
 
virtual ctkValueProxyvalueProxy () const
 
virtual ~ctkSliderWidget ()
 

Protected Slots

virtual void onValueProxyAboutToBeModified ()
 
virtual void onValueProxyModified ()
 
virtual void setSliderValue (double spinBoxValue)
 
virtual void setSpinBoxValue (double sliderValue)
 
virtual void startChanging ()
 
virtual void stopChanging ()
 

Protected Member Functions

virtual bool eventFilter (QObject *obj, QEvent *event)
 

Protected Attributes

QScopedPointer< ctkSliderWidgetPrivate > d_ptr
 

Properties

int decimals
 
bool invertedAppearance
 
bool invertedControls
 
double maximum
 
double minimum
 
double pageStep
 
bool popupSlider
 
QString prefix
 
double singleStep
 
Qt::Alignment spinBoxAlignment
 
bool spinBoxVisible
 
QString suffix
 
SynchronizeSiblings synchronizeSiblings
 
double tickInterval
 
QSlider::TickPosition tickPosition
 
bool tracking
 
double value
 

Detailed Description

ctkSliderWidget is a wrapper around a ctkDoubleSlider and a ctkDoubleSpinBox where the slider value and the spinbox value are synchronized.

See also
ctkRangeWidget, ctkDoubleRangeSlider, QDoubleSpinBox

Definition at line 43 of file ctkSliderWidget.h.

Member Typedef Documentation

◆ Superclass

typedef QWidget ctkSliderWidget::Superclass

Superclass typedef.

Definition at line 93 of file ctkSliderWidget.h.

Member Enumeration Documentation

◆ SynchronizeSibling

Synchronize properties of the slider siblings: NoSynchronize: The slider widget siblings aren't updated and this widget does not update from its siblings. SynchronizeWidth: The width of the SpinBox is set to the same width of the largest QDoubleSpinBox of its ctkSliderWidget siblings. SynchronizeDecimals: Whenever one of the siblings changes its number of decimals, all its siblings Synchronize to the new number of decimals.

Default is SynchronizeWidth.

See also
SynchronizeSiblings(), setSynchronizeSiblings(), decimalsChanged()
Enumerator
NoSynchronize 
SynchronizeWidth 
SynchronizeDecimals 

Definition at line 84 of file ctkSliderWidget.h.

Constructor & Destructor Documentation

◆ ctkSliderWidget()

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

Constructors.

◆ ~ctkSliderWidget()

virtual ctkSliderWidget::~ctkSliderWidget ( )
virtual

Member Function Documentation

◆ decimals()

virtual int ctkSliderWidget::decimals ( ) const
virtual

Return the decimals property value.

See also
decimals, setDecimals(), decimalsChanged()

◆ decimalsChanged

void ctkSliderWidget::decimalsChanged ( int  decimals)
signal

This signal is emitted whenever the number of decimals is changed.

See also
decimals, SynchronizeDecimals

◆ eventFilter()

virtual bool ctkSliderWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
protectedvirtual

◆ hasPopupSlider()

virtual bool ctkSliderWidget::hasPopupSlider ( ) const
virtual

The slider can be handled as a popup for the spinbox. The location where the popup appears is controlled by

See also
alignement. False by default. Note: some sizing issues in the popup can happen if the ctkSliderWidget has already parent. You might want to consider setting this property before setting a parent to ctkSliderWidget.

◆ hasTracking()

virtual bool ctkSliderWidget::hasTracking ( ) const
virtual

◆ invertedAppearance()

virtual bool ctkSliderWidget::invertedAppearance ( ) const
virtual

◆ invertedControls()

virtual bool ctkSliderWidget::invertedControls ( ) const
virtual

◆ isSpinBoxVisible()

virtual bool ctkSliderWidget::isSpinBoxVisible ( ) const
virtual

The Spinbox visibility can be controlled using setSpinBoxVisible() and isSpinBoxVisible().

◆ maximum()

virtual double ctkSliderWidget::maximum ( ) const
virtual

This property holds the sliders and spinbox minimum value. FIXME: Test following specs. 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.

◆ minimum()

virtual double ctkSliderWidget::minimum ( ) const
virtual

This property holds the sliders and spinbox minimum value. FIXME: Test following specs. 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.

◆ onValueProxyAboutToBeModified

virtual void ctkSliderWidget::onValueProxyAboutToBeModified ( )
protectedvirtualslot

◆ onValueProxyModified

virtual void ctkSliderWidget::onValueProxyModified ( )
protectedvirtualslot

◆ pageStep()

virtual double ctkSliderWidget::pageStep ( ) const
virtual

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.

◆ popup()

virtual ctkPopupWidget* ctkSliderWidget::popup ( ) const
virtual

Return the popup if ctkSliderWidget hasPopupSlider() is true, 0 otherwise. It can be useful to control where the popup shows up relative to the spinbox the popup

See also
ctkPopupWidget::baseWidget.

◆ prefix()

virtual QString ctkSliderWidget::prefix ( ) const
virtual

This property holds the spin box's prefix. The prefix is prepended to the start of the displayed value. Typical use is to display a unit of measurement or a currency symbol

◆ reset

virtual void ctkSliderWidget::reset ( )
virtualslot

Reset the slider and spinbox to zero (value and position)

◆ setDecimals

virtual void ctkSliderWidget::setDecimals ( int  decimals)
virtualslot

Sets how many decimals the spinbox uses for displaying and interpreting doubles.

◆ setInvertedAppearance()

virtual void ctkSliderWidget::setInvertedAppearance ( bool  invertedAppearance)
virtual

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()

virtual void ctkSliderWidget::setInvertedControls ( bool  invertedControls)
virtual

This property holds whether or not the slider and the spinbox invert their wheel and key events. If this property is false, scrolling the mouse wheel "up" and using keys like page up will increase the value of the slider widget towards its maximum. Otherwise, pressing page up will move value towards the minimum. The default value of the property is false.

See also
invertedAppearance

◆ setMaximum()

virtual void ctkSliderWidget::setMaximum ( double  maximum)
virtual

◆ setMinimum()

virtual void ctkSliderWidget::setMinimum ( double  minimum)
virtual

◆ setPageStep()

virtual void ctkSliderWidget::setPageStep ( double  step)
virtual

◆ setPopupSlider()

virtual void ctkSliderWidget::setPopupSlider ( bool  popup)
virtual

◆ setPrefix()

virtual void ctkSliderWidget::setPrefix ( const QString &  prefix)
virtual

◆ setRange()

virtual void ctkSliderWidget::setRange ( double  min,
double  max 
)
virtual

Description Utility function that set the min/max in once

◆ setSingleStep()

virtual void ctkSliderWidget::setSingleStep ( double  step)
virtual

◆ setSliderValue

virtual void ctkSliderWidget::setSliderValue ( double  spinBoxValue)
protectedvirtualslot

◆ setSpinBoxAlignment()

virtual void ctkSliderWidget::setSpinBoxAlignment ( Qt::Alignment  alignment)
virtual

This property holds the alignment of the spin box. Possible Values are Qt::AlignLeft, Qt::AlignRight, and Qt::AlignHCenter. By default, the alignment is Qt::AlignLeft

◆ setSpinBoxValue

virtual void ctkSliderWidget::setSpinBoxValue ( double  sliderValue)
protectedvirtualslot

◆ setSpinBoxVisible

virtual void ctkSliderWidget::setSpinBoxVisible ( bool  )
virtualslot

◆ setSuffix()

virtual void ctkSliderWidget::setSuffix ( const QString &  suffix)
virtual

◆ setSynchronizeSiblings()

virtual void ctkSliderWidget::setSynchronizeSiblings ( ctkSliderWidget::SynchronizeSiblings  options)
virtual

◆ setTickInterval()

virtual void ctkSliderWidget::setTickInterval ( double  tick)
virtual

◆ setTickPosition()

virtual void ctkSliderWidget::setTickPosition ( QSlider::TickPosition  position)
virtual

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

◆ setTracking()

virtual void ctkSliderWidget::setTracking ( bool  enable)
virtual

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

◆ setValue

virtual void ctkSliderWidget::setValue ( double  value)
virtualslot

◆ setValueProxy()

virtual void ctkSliderWidget::setValueProxy ( ctkValueProxy proxy)
virtual

Set/Get a value proxy filter. This simply sets the same value proxy filter on the spinbox and the slider

See also
setValueProxy(), valueProxy()

◆ singleStep()

virtual double ctkSliderWidget::singleStep ( ) const
virtual

This property holds the single step. The smaller of two natural steps that the slider provides and typically corresponds to the user pressing an arrow key.

◆ slider()

virtual ctkDoubleSlider* ctkSliderWidget::slider ( )
virtual

Returns the slider synchronized with the spinbox. Be careful with what you do with the slider as the spinbox might change properties automatically.

◆ spinBox()

virtual ctkDoubleSpinBox* ctkSliderWidget::spinBox ( )
virtual

Returns the spinbox synchronized with the slider. Be careful with what you do with the spinbox as the slider might change properties automatically.

◆ spinBoxAlignment()

virtual Qt::Alignment ctkSliderWidget::spinBoxAlignment ( ) const
virtual

◆ startChanging

virtual void ctkSliderWidget::startChanging ( )
protectedvirtualslot

◆ stopChanging

virtual void ctkSliderWidget::stopChanging ( )
protectedvirtualslot

◆ suffix()

virtual QString ctkSliderWidget::suffix ( ) const
virtual

This property holds the spin box's suffix. The suffix is appended to the end of the displayed value. Typical use is to display a unit of measurement or a currency symbol

◆ synchronizeSiblings()

virtual ctkSliderWidget::SynchronizeSiblings ctkSliderWidget::synchronizeSiblings ( ) const
virtual

Set/Get the synchronize siblings mode. This helps when having multiple ctkSliderWidget stacked upon each other. Default flag is SynchronizeWidth | SynchronizeDecimals.

See also
SynchronizeSiblingsModes

◆ tickInterval()

virtual double ctkSliderWidget::tickInterval ( ) const
virtual

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.

◆ tickPosition()

virtual QSlider::TickPosition ctkSliderWidget::tickPosition ( ) const
virtual

◆ value()

virtual double ctkSliderWidget::value ( ) const
virtual

This property holds the current slider position. If tracking is enabled (the default), this is identical to value. This property holds the slider and spinbox current value. ctkSliderWidget forces the value to be within the legal range: minimum <= value <= maximum.

◆ valueChanged

void ctkSliderWidget::valueChanged ( double  value)
signal

When tracking is on (default), valueChanged is emitted when the user drags the slider. If tracking is off, valueChanged() is emitted only when the user releases the mouse.

See also
valueIsChanging QAbstractSlider::valueChanged

◆ valueIsChanging

void ctkSliderWidget::valueIsChanging ( double  value)
signal

valueIsChanging() is emitted whenever the slider is dragged and tracking is turned off. You might want to use valueChanged instead. It behaves the same way than QAbstractSlider::sliderMoved()

See also
valueChanged QAbstractSlider::sliderMoved

◆ valueProxy()

virtual ctkValueProxy* ctkSliderWidget::valueProxy ( ) const
virtual

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkSliderWidgetPrivate> ctkSliderWidget::d_ptr
protected

Definition at line 310 of file ctkSliderWidget.h.

Property Documentation

◆ decimals

int ctkSliderWidget::decimals
readwrite

This property holds the precision of the spin box, in decimals. 2 by default.

See also
decimals(), setDecimals(), decimalsChanged()

Definition at line 318 of file ctkSliderWidget.h.

◆ invertedAppearance

bool ctkSliderWidget::invertedAppearance
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ invertedControls

bool ctkSliderWidget::invertedControls
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ maximum

double ctkSliderWidget::maximum
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ minimum

double ctkSliderWidget::minimum
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ pageStep

double ctkSliderWidget::pageStep
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ popupSlider

bool ctkSliderWidget::popupSlider
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ prefix

QString ctkSliderWidget::prefix
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ singleStep

double ctkSliderWidget::singleStep
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ spinBoxAlignment

Qt::Alignment ctkSliderWidget::spinBoxAlignment
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ spinBoxVisible

bool ctkSliderWidget::spinBoxVisible
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ suffix

QString ctkSliderWidget::suffix
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ synchronizeSiblings

SynchronizeSiblings ctkSliderWidget::synchronizeSiblings
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ tickInterval

double ctkSliderWidget::tickInterval
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ tickPosition

QSlider::TickPosition ctkSliderWidget::tickPosition
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ tracking

bool ctkSliderWidget::tracking
readwrite

Definition at line 318 of file ctkSliderWidget.h.

◆ value

double ctkSliderWidget::value
readwrite

Definition at line 318 of file ctkSliderWidget.h.


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