ImFusion SDK 4.3
LabeledSlider Class Reference

#include <ImFusion/GUI/CoreWidgets/LabeledSlider.h>

This class wraps a QSlider and two QLabels. More...

+ Inheritance diagram for LabeledSlider:

Detailed Description

This class wraps a QSlider and two QLabels.

The labels are positioned at the two ends of the slider in a layout. A default implementation of updateLabels() that changes the front label according to the curremt slider's values is provided (and can be overridden).

Public Types

enum class  LabelVisibility { None = 0 , Front = 1 , Back = 2 , Both = 3 }
 Sets the visibility of front/back labels.
 

Signals

void sliderValueChanged (int)
 Emitted when the value is changed by interaction with the slider.
 

Public Member Functions

 LabeledSlider (Qt::Orientation ori=Qt::Orientation::Horizontal, LabelVisibility visibility=LabelVisibility::Both, QWidget *parent=nullptr)
 Construct with slider orientation, label visibility, and parent.
 
void setFrontLabelFormat (const QString &frontFormat)
 Set the (format) string to be displayed by the label.
 
void setBackLabelFormat (const QString &backFormat)
 \copyDoc setFrontLabelFormat()
 
void setSliderRange (int min, int max)
 Sets the slider range and calls updateLabels()
 
void setSliderValue (int val)
 Sets the slider value and calls updateLabels()
 

Protected Member Functions

virtual void updateLabels ()
 Updates the values displayed by the labels according to slider values.
 

Protected Attributes

QLabel * m_backLabel = nullptr
 
QLabel * m_frontLabel = nullptr
 
QSlider * m_slider = nullptr
 
QString m_frontFormatString = ""
 
QString m_backFormatString = ""
 

Member Function Documentation

◆ setFrontLabelFormat()

void setFrontLabelFormat ( const QString & frontFormat)

Set the (format) string to be displayed by the label.

The placeholders are: {current}, {maximum}, {minimum} for the current, maximum, minimum values of the slider respectively.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close