Open 3D Engine AzQtComponents API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzQtComponents::SliderDouble Class Reference

Control to display a slider for double value input. More...

#include <Slider.h>

Inherits AzQtComponents::Slider.

Signals

void valueChanged (double value)
 
void rangeChanged (double min, double max, int numSteps)
 Triggered when the minimum, maximum or steps values are changed.
 
- Signals inherited from AzQtComponents::Slider
void sliderPressed ()
 Triggered when the user presses the slider handle.
 
void sliderMoved (int position)
 Triggered when the slider handle position changes via dragging.
 
void sliderReleased ()
 Triggered when the user releases the slider handle.
 
void actionTriggered (int action)
 

Public Member Functions

 SliderDouble (QWidget *parent=nullptr)
 
 SliderDouble (Qt::Orientation orientation, QWidget *parent=nullptr)
 
void setValue (double value)
 Sets the current value.
 
double value () const
 Gets the current value.
 
void setMinimum (double min)
 Sets the minimum value selectable with this slider.
 
double minimum () const
 Gets the minimum value selectable with this slider.
 
void setMaximum (double max)
 Sets the maximum value selectable with this slider.
 
double maximum () const
 Gets the maximum value selectable with this slider.
 
void setRange (double min, double max, int numSteps=100)
 Sets the minimum and maximum values.
 
void setNumSteps (int steps)
 Sets the number of steps, which are used when changing value via the arrow keys.
 
int numSteps () const
 Gets the number of steps.
 
void setDecimals (int decimals)
 Sets the decimal precision the value is returned with.
 
int decimals () const
 Gets the decimal precision the value is returned with.
 
void setCurveMidpoint (double midpoint)
 
double curveMidpoint () const
 Gets the current curve midpoint setting.
 
- Public Member Functions inherited from AzQtComponents::Slider
 Slider (QWidget *parent=nullptr)
 
 Slider (Qt::Orientation orientation, QWidget *parent=nullptr)
 
void setOrientation (Qt::Orientation orientation)
 Sets the slider orientation.
 
Qt::Orientation orientation () const
 Gets the slider orientation.
 
void setToolTipOffset (const QPoint &toolTipOffset)
 Sets a custom tooltip offset for this Slider.
 
QPoint toolTipOffset () const
 Gets the tooltip offset for this Slider.
 
void setToolTipOffsetX (int toolTipOffsetX)
 Sets the X component for the tooltip offset for this Slider.
 
int toolTipOffsetX () const
 Gets the X component of the tooltip offset for this Slider.
 
void setToolTipOffsetY (int toolTipOffsetY)
 Sets the Y component for the tooltip offset for this Slider.
 
int toolTipOffsetY () const
 Gets the Y component of the tooltip offset for this Slider.
 
void setToolTipFormatting (const QString &prefix, const QString &postFix)
 
void sliderIsInMoving (bool b)
 Sets the flag that determines whether the handle is being dragged, stopping event detection.
 
bool IsSliderBeingMoved () const
 Returns whether the handle is being dragged.
 
QSize minimumSizeHint () const override
 Returns the recommended minimum size of the underlying QSlider.
 
QSize sizeHint () const override
 Returns the recommended size of the underlying QSlider.
 
void setFocusProxy (QWidget *proxy)
 Exposes the setFocusProxy function from the underlying Slider.
 
QWidget * focusProxy () const
 Exposes the focusProxy function from the underlying Slider.
 
void setTracking (bool enable)
 Exposes the setTracking function from the underlying Slider.
 
bool hasTracking () const
 Exposes the hasTracking function from the underlying Slider.
 

Protected Member Functions

QString hoverValueText (int sliderValue) const override
 
double calculateRealSliderValue (int value) const
 
double convertToSliderValue (double value) const
 
double convertFromSliderValue (double value) const
 
double convertPowerCurveValue (double value, bool fromSlider) const
 
- Protected Member Functions inherited from AzQtComponents::Slider
virtual QString hoverValueText (int sliderValue) const =0
 
bool eventFilter (QObject *watched, QEvent *event) override
 
void ShowValueToolTip (int sliderPos)
 

Properties

double minimum
 Minimum value. Will be to the left in horizontal sliders, or at the bottom in vertical ones.
 
double maximum
 Maximum value. Will be to the right in horizontal sliders, or at the top in vertical ones.
 
int numSteps
 The number of steps used when changing the value via the arrow keys.
 
double value
 The current value for the slider.
 
int decimals
 The decimal precision the value is returned with.
 
double curveMidpoint
 
- Properties inherited from AzQtComponents::Slider
Qt::Orientation orientation
 Orientation of the slider. Horizontal sliders increase left to right, vertical ones are bottom to top.
 
int toolTipOffsetX
 Horizontal offset for the tooltip displaying the value on hover, in pixels.
 
int toolTipOffsetY
 Vertical offset for the tooltip displaying the value on hover, in pixels.
 

Additional Inherited Members

- Static Public Member Functions inherited from AzQtComponents::Slider
static void showHoverToolTip (const QString &toolTipText, const QPoint &globalPosition, QSlider *slider, QWidget *toolTipParentWidget, int width, int height, const QPoint &toolTipOffset)
 Shows a hover tooltip with the right positioning on top of a slider.
 
static int valueFromPosition (QSlider *slider, const QPoint &pos, int width, int height, int bottom)
 Returns the slider value at the position specified.
 
static void applyMidPointStyle (Slider *slider)
 
static void initStaticVars (const QPoint &verticalToolTipOffset, const QPoint &horizontalToolTipOffset)
 
static Config loadConfig (QSettings &settings)
 
static Config defaultConfig ()
 Gets the default Slider style configuration.
 
- Protected Attributes inherited from AzQtComponents::Slider
CustomSliderm_slider = nullptr
 
QString m_toolTipPrefix
 
QString m_toolTipPostfix
 

Detailed Description

Control to display a slider for double value input.

Member Function Documentation

◆ hoverValueText()

QString AzQtComponents::SliderDouble::hoverValueText ( int  sliderValue) const
overrideprotectedvirtual

◆ setCurveMidpoint()

void AzQtComponents::SliderDouble::setCurveMidpoint ( double  midpoint)

Sets a non-linear scale power curve. Defaults to 0.5, which is a linear curve. Lowering or raising the midpoint value will shift the scale to have higher precision at the lower or higher end, respectively.

◆ valueChanged

void AzQtComponents::SliderDouble::valueChanged ( double  value)
signal

Triggered when the slider's value has been changed. The tracking setting determines whether this signal is emitted during user interaction.

Property Documentation

◆ curveMidpoint

double AzQtComponents::SliderDouble::curveMidpoint
readwrite

An optional non-linear scale setting using a power curve. Defaults to 0.5, which is a linear curve. Lowering or raising the midpoint value will shift the scale to have higher precision at the lower or higher end, respectively.


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