itom 2.2.1
|
#include <sliderWidget.h>
Public Types | |
enum | SynchronizeSibling { NoSynchronize = 0x000, SynchronizeWidth = 0x001, SynchronizeDecimals = 0x002 } |
typedef QWidget | Superclass |
Superclass typedef. | |
Public Slots | |
virtual void | reset () |
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 PopupWidget * | popup () const |
virtual DoubleSpinBox * | spinBox () |
virtual DoubleSlider * | slider () |
virtual void | setValueProxy (ValueProxy *proxy) |
virtual ValueProxy * | valueProxy () 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 < SliderWidgetPrivate > | d_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) |
SliderWidget is a wrapper around a DoubleSlider and a DoubleSpinBox where the slider value and the spinbox value are synchronized.
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.
virtual int SliderWidget::decimals | ( | ) | const [virtual] |
Return the decimals property value.
void SliderWidget::decimalsChanged | ( | int | decimals | ) | [signal] |
This signal is emitted whenever the number of decimals is changed.
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
bool SliderWidget::isSpinBoxVisible | ( | ) | const [virtual] |
The Spinbox visibility can be controlled using setSpinBoxVisible() and isSpinBoxVisible().
virtual 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.
virtual 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.
virtual 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.
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
virtual 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
void SliderWidget::reset | ( | ) | [virtual, slot] |
Reset the slider and spinbox to zero (value and position)
void SliderWidget::setDecimals | ( | int | decimals | ) | [virtual, slot] |
Sets how many decimals the spinbox uses for displaying and interpreting doubles.
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.
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.
void SliderWidget::setPopupSlider | ( | bool | popup | ) | [virtual] |
If the Slider has already been created, it will try to keep its size.
void SliderWidget::setRange | ( | double | min, |
double | max | ||
) | [virtual] |
Description Utility function that set the min/max in once
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
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.
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.
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
virtual 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.
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.
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.
virtual 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
virtual 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.
virtual 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.
virtual 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.
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.
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()
int SliderWidget::decimals [read, write] |
This property holds the precision of the spin box, in decimals. 2 by default.