Skip to content

Class QSliderPopup

ClassList > QSliderPopup

Popup widget containing a labeled slider. More...

  • #include <widgets.h>

Inherits the following classes: QWidget

Public Functions

Type Name
QSliderPopup (int min, int max, int value, Qt::Orientation orientation, QWidget * parent=nullptr)
Constructs a frameless popup widget containing a labeled slider with a specified range and orientation.
void SetDisplayLabels (const bool value) const
Sets whether text labels are displayed along the slider.
void SetLabelInterval (const int value) const
Sets the interval for displaying labels on the slider.
void SetMaximum (const int max) const
Sets the maximum value of the slider.
void SetMinimum (const int min) const
Sets the minimum value of the slider.
int value () const
returns the value of the slider.

Detailed Description

This class implements a popup widget that encapsulates a custom labeled slider widget. It provides functionality to access the slider's value as well as modify its minimum and maximum bounds. The slider is displayed within a vertical layout to ensure proper placement within the widget.

Public Functions Documentation

function QSliderPopup

Constructs a frameless popup widget containing a labeled slider with a specified range and orientation.

QSliderPopup::QSliderPopup (
    int min,
    int max,
    int value,
    Qt::Orientation orientation,
    QWidget * parent=nullptr
) 

This constructor initializes a QSliderPopup containing a QSliderLabeled widget integrated within a vertical layout. The slider is configured with the provided minimum value, maximum value, and default value. The orientation of the slider (horizontal or vertical) is set based on the given parameter. The widget is styled as a frameless popup window.

Parameters:

  • min The minimum value of the slider.
  • max The maximum value of the slider.
  • value The initial value of the slider.
  • orientation The orientation of the slider (Qt::Horizontal or Qt::Vertical).
  • parent The parent widget of the popup, can be null.

Returns:

An instance of the QSliderPopup class.


function SetDisplayLabels

Sets whether text labels are displayed along the slider.

inline void QSliderPopup::SetDisplayLabels (
    const bool value
) const

This method enables or disables the display of labels on the slider based on the input value. When set to true, labels corresponding to values in the slider are shown, otherwise, labels are hidden.

Parameters:

  • value Boolean indicating whether to display labels (true) or not (false).

function SetLabelInterval

Sets the interval for displaying labels on the slider.

inline void QSliderPopup::SetLabelInterval (
    const int value
) const

Defines the interval between adjacent labels displayed along the slider. This allows customization of how frequently labels appear on the slider based on the specified interval value.

Parameters:

  • value The numerical value representing the interval between labels

function SetMaximum

Sets the maximum value of the slider.

inline void QSliderPopup::SetMaximum (
    const int max
) const

Parameters:

  • max maximum value.

function SetMinimum

Sets the minimum value of the slider.

inline void QSliderPopup::SetMinimum (
    const int min
) const

Parameters:

  • min minimum value.

function value

returns the value of the slider.

inline int QSliderPopup::value () const

Returns:

value of hte slider.



The documentation for this class was generated from the following file src/widgets.h