NDEVR
API Documentation
QCustomSlider

The slider is the classic widget for controlling a bounded value. More...

Inheritance diagram for QCustomSlider:
[legend]

Public Member Functions

 QCustomSlider (Qt::Orientation orientation, QWidget *parent=nullptr)
 Constructs a slider with the specified orientation.
 QCustomSlider (QWidget *parent=nullptr)
 Constructs a slider with default orientation.
void edited (fltp08 percent)
 Signal emitted when the slider value changes.
void editingFinished ()
 Signal emitted when the user finishes editing the slider value.
fltp08 getValue () const
 Returns the current slider value as a floating-point percent.
void setMaximum (fltp08 value)
 Sets the maximum slider value from a floating-point value.
void setMinimum (fltp08 value)
 Sets the minimum slider value from a floating-point value.
void setRange (fltp08 min, fltp08 max)
 Sets the minimum and maximum range of the slider.
void setValue (fltp08 value)
 Sets the slider value from a floating-point percent.
void setVertical (bool is_vertical)
 Sets the slider orientation to vertical or horizontal.

Protected Member Functions

void init ()
 Initializes the slider with default settings and signal connections.
void onEditedSlot ()
 Slot called when the slider value is edited by the user.
fltp08 sliderScale () const
 Returns the internal scale factor used to convert between floating-point values and the integer-based QSlider range.

Detailed Description

The slider is the classic widget for controlling a bounded value.


It lets the user move a slider handle along a horizontal or vertical groove and translates the handle's position into a percent value 0.0 to 1.0.

Definition at line 13 of file QCustomSlider.h.

Constructor & Destructor Documentation

◆ QCustomSlider() [1/2]

QCustomSlider::QCustomSlider ( Qt::Orientation orientation,
QWidget * parent = nullptr )
inline

Constructs a slider with the specified orientation.

Parameters
[in]orientationThe orientation of the slider (horizontal or vertical).
[in]parentThe parent widget, or nullptr for no parent.

Definition at line 22 of file QCustomSlider.h.

References init().

◆ QCustomSlider() [2/2]

QCustomSlider::QCustomSlider ( QWidget * parent = nullptr)
inline

Constructs a slider with default orientation.

Parameters
[in]parentThe parent widget, or nullptr for no parent.

Definition at line 31 of file QCustomSlider.h.

References init().

Member Function Documentation

◆ edited()

void QCustomSlider::edited ( fltp08 percent)

Signal emitted when the slider value changes.

Parameters
[in]percentThe new slider value as a floating-point percent.

◆ getValue()

fltp08 QCustomSlider::getValue ( ) const
inline

Returns the current slider value as a floating-point percent.

Returns
The current value normalized by the slider scale.

Definition at line 40 of file QCustomSlider.h.

References cast(), and sliderScale().

◆ setMaximum()

void QCustomSlider::setMaximum ( fltp08 value)
inline

Sets the maximum slider value from a floating-point value.

Parameters
[in]valueThe maximum value, scaled by the internal slider scale.

Definition at line 56 of file QCustomSlider.h.

References cast(), and sliderScale().

◆ setMinimum()

void QCustomSlider::setMinimum ( fltp08 value)
inline

Sets the minimum slider value from a floating-point value.

Parameters
[in]valueThe minimum value, scaled by the internal slider scale.

Definition at line 64 of file QCustomSlider.h.

References cast(), and sliderScale().

◆ setRange()

void QCustomSlider::setRange ( fltp08 min,
fltp08 max )

Sets the minimum and maximum range of the slider.

Parameters
[in]minThe minimum value of the range.
[in]maxThe maximum value of the range.

◆ setValue()

void QCustomSlider::setValue ( fltp08 value)
inline

Sets the slider value from a floating-point percent.

Parameters
[in]valueThe value to set, scaled by the internal slider scale.

Definition at line 48 of file QCustomSlider.h.

References cast(), and sliderScale().

Referenced by MaterialPropertySlider::refreshFromMaterial().

◆ setVertical()

void QCustomSlider::setVertical ( bool is_vertical)

Sets the slider orientation to vertical or horizontal.

Parameters
[in]is_verticalTrue for vertical orientation, false for horizontal.

◆ sliderScale()

fltp08 QCustomSlider::sliderScale ( ) const
inlineprotected

Returns the internal scale factor used to convert between floating-point values and the integer-based QSlider range.

Returns
The scale factor (default 100.0).

Definition at line 85 of file QCustomSlider.h.

Referenced by getValue(), setMaximum(), setMinimum(), and setValue().


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