itom
Loading...
Searching...
No Matches
SliderWidget Class Reference

#include <sliderWidget.h>

Inheritance diagram for SliderWidget:

Public Types

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

Public Slots

virtual void reset ()
 Reset the slider and spinbox to zero (value and position)
 
virtual void setValue (double value)
 
virtual void setSpinBoxVisible (bool)
 
virtual void setDecimals (int decimals)
 

Signals

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

Public Member Functions

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

Protected Slots

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

Protected Member Functions

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

Protected Attributes

QScopedPointer< SliderWidgetPrivated_ptr
 

Properties

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

Private Member Functions

 Q_DECLARE_PRIVATE (SliderWidget)
 
 Q_DISABLE_COPY (SliderWidget)
 

Detailed Description

SliderWidget is a wrapper around a DoubleSlider and a DoubleSpinBox where the slider value and the spinbox value are synchronized.

See also
RangeWidget, DoubleRangeSlider, QDoubleSpinBox

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

Member Function Documentation

◆ decimals()

int SliderWidget::decimals ( ) const
virtual

Return the decimals property value.

See also
decimals, setDecimals(), decimalsChanged()

◆ decimalsChanged

void SliderWidget::decimalsChanged ( int decimals)
signal

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

See also
decimals, SynchronizeDecimals

◆ hasPopupSlider()

bool SliderWidget::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
alignment. 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.

◆ isSpinBoxVisible()

bool SliderWidget::isSpinBoxVisible ( ) const
virtual

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

◆ maximum()

double SliderWidget::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()

double SliderWidget::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.

◆ pageStep()

double SliderWidget::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()

PopupWidget * SliderWidget::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()

QString SliderWidget::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

◆ setDecimals

void SliderWidget::setDecimals ( int decimals)
virtualslot

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

◆ setInvertedAppearance()

void SliderWidget::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()

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

◆ setPopupSlider()

void SliderWidget::setPopupSlider ( bool popup)
virtual

If the Slider has already been created, it will try to keep its size.

◆ setRange()

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

Description Utility function that set the min/max in once

◆ setSpinBoxAlignment()

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

◆ setTickPosition()

void SliderWidget::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()

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

◆ setValueProxy()

void SliderWidget::setValueProxy ( ValueProxy * 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()

double SliderWidget::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()

DoubleSlider * SliderWidget::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()

DoubleSpinBox * SliderWidget::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.

◆ suffix()

QString SliderWidget::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()

SliderWidget::SynchronizeSiblings SliderWidget::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()

double SliderWidget::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.

◆ value()

double SliderWidget::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 SliderWidget::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 SliderWidget::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

Property Documentation

◆ decimals

int SliderWidget::decimals
readwrite

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

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

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