The LabelSlider class.
More...
#include <labelslider.h>
The LabelSlider class.
A UI element that shows a number and can be dragged to increase/decrease its value or clicked to enter a specific one.
◆ LabelSlider()
| LabelSlider::LabelSlider |
( |
QWidget * |
parent = nullptr | ) |
|
◆ clicked
| void LabelSlider::clicked |
( |
| ) |
|
|
signal |
clicked signal
Emitted if the user clicks on the LabelSlider in any way
◆ getPreviousValue()
| double LabelSlider::getPreviousValue |
( |
| ) |
|
Returns whatever value was set before the last set_value()
For various reasons (largely undo capabilities) it is helpful to retrieve whatever the value was before the current one. If the user dragged the current value, this will return the value just before the user started dragging.
- Returns
- The previous value
◆ is_dragging()
| bool LabelSlider::is_dragging |
( |
| ) |
|
Returns whether the user is currently dragging.
- Returns
- TRUE if the user is dragging, FALSE if not.
◆ is_set()
| bool LabelSlider::is_set |
( |
| ) |
|
Returns whether a value has been set or not.
If a value has been entered by any means (i.e. if set_value() was called), this will be TRUE. If set_value() has not been called and is_set() is FALSE, calling set_default_value() will automatically set the value to the default value WITHOUT changing the is_set() state (i.e. it will still be FALSE and calling set_default_value() again will change the current value again unless it's been changed through some other means in that time).
- Returns
- TRUE if a value has been set, FALSE if not.
◆ mouseMoveEvent()
| void LabelSlider::mouseMoveEvent |
( |
QMouseEvent * |
ev | ) |
|
|
protected |
◆ mousePressEvent()
| void LabelSlider::mousePressEvent |
( |
QMouseEvent * |
ev | ) |
|
|
protected |
◆ mouseReleaseEvent()
| void LabelSlider::mouseReleaseEvent |
( |
QMouseEvent * |
ev | ) |
|
|
protected |
◆ set_active_cursor()
| void LabelSlider::set_active_cursor |
( |
| ) |
|
|
private |
Internal function to set the cursor while dragging (usually NoCursor aka invisible)
◆ set_color()
| void LabelSlider::set_color |
( |
QString |
c = nullptr | ) |
|
Set the display color.
- Parameters
-
◆ set_default_cursor()
| void LabelSlider::set_default_cursor |
( |
| ) |
|
|
private |
Internal function to set the standard cursor (usually SizeHorCursor)
◆ set_default_value()
| void LabelSlider::set_default_value |
( |
double |
v | ) |
|
Set the default value.
If a default value is set, alt+clicking the LabelSlider will return to the default value.
- Parameters
-
◆ set_display_type()
| void LabelSlider::set_display_type |
( |
int |
type | ) |
|
Sets the way to display the value.
LABELSLIDER_NORMAL - Shows the value as a normal number
LABELSLIDER_FRAMENUMBER - Shows the number as a timecode according to config.timecode_view. By default, will render hh:mm:ss:ff
LABELSLIDER_PERCENT - Shows the number as a percentage. 1.0 becomes "100%", 0.5 becomes 50%, etc.
LABELSLIDER_DECIBLE - Shows the number as a decibel. 1.0 becomes "0 dB", 2.0 becames roughly "6 dB", 0.5 becomes roughly "-6 dB", etc.
- Parameters
-
| type | The display type to set to. Should be a member of enum LabelSliderDisplayType. |
◆ set_frame_rate()
| void LabelSlider::set_frame_rate |
( |
double |
d | ) |
|
Set the display frame rate.
If the display_type is set to LABELSLIDER_FRAMENUMBER, this function sets how many frames per second the timecode will be in.
- Parameters
-
◆ set_maximum_value()
| void LabelSlider::set_maximum_value |
( |
double |
v | ) |
|
Set the maximum value.
If a maximum value is set, the value will never go above it. If the user manually sets a value higher than the maximum, it will automatically snap to the maximum.
- Parameters
-
◆ set_minimum_value()
| void LabelSlider::set_minimum_value |
( |
double |
v | ) |
|
Set the minimum value.
If a minimum value is set, the value will never go below it. If the user manually sets a value lower than the minimum, it will automatically snap to the minimum.
- Parameters
-
◆ set_previous_value()
| void LabelSlider::set_previous_value |
( |
| ) |
|
Updates previous value.
Called internally to store the current value as the previous value in anticipation of an upcoming value change. Can also be called externally (mainly for dragged EffectGizmos) in anticipation of an external change.
◆ set_value()
| void LabelSlider::set_value |
( |
double |
v, |
|
|
bool |
userSet |
|
) |
| |
Set the value.
- Parameters
-
| v | Value to set to. |
| userSet | TRUE if this was called through a user action, FALSE if this was called through some other way. The only difference is TRUE will emit a signal (valueChanged()) indicating that the value has changed, and FALSE will not. |
◆ value()
| double LabelSlider::value |
( |
| ) |
|
Returns the internal value as a double.
- Returns
- The internal value. This will not respect the
display_type, i.e. 100% will return as 1.0, 12dB will return as 400%, and a timecode will return as a frame number.
◆ valueChanged
| void LabelSlider::valueChanged |
( |
| ) |
|
|
signal |
valueChanged signal
Emitted if the value changed at it was instigated by the user.
◆ valueToString()
| QString LabelSlider::valueToString |
( |
| ) |
|
Convert the internal value to a displayed string according to display_type
- Returns
- The internal value as a string
◆ decimal_places
| int LabelSlider::decimal_places |
Set how many decimal places to show for a floating-point number.
Defaults to 1
◆ default_value
| double LabelSlider::default_value |
|
private |
◆ display_type
| int LabelSlider::display_type |
|
private |
◆ drag_proc
| bool LabelSlider::drag_proc |
|
private |
◆ drag_start
| bool LabelSlider::drag_start |
|
private |
◆ drag_start_value
| double LabelSlider::drag_start_value |
|
private |
◆ drag_start_x
| int LabelSlider::drag_start_x |
|
private |
◆ drag_start_y
| int LabelSlider::drag_start_y |
|
private |
◆ frame_rate
| double LabelSlider::frame_rate |
|
private |
◆ internal_value
| double LabelSlider::internal_value |
|
private |
◆ max_enabled
| bool LabelSlider::max_enabled |
|
private |
◆ max_value
| double LabelSlider::max_value |
|
private |
◆ min_enabled
| bool LabelSlider::min_enabled |
|
private |
◆ min_value
| double LabelSlider::min_value |
|
private |
◆ previous_value
| double LabelSlider::previous_value |
|
private |
◆ set
The documentation for this class was generated from the following files: