CCIMXDesktop
 
Loading...
Searching...
No Matches
BoundSliderFactory< default_value, min, max > Class Template Reference

Factory class for creating bounded QSlider widgets. More...

#include <BoundProgressBarFactory.hpp>

Inheritance diagram for BoundSliderFactory< default_value, min, max >:

Public Member Functions

 BoundSliderFactory (QSlider *barWidget, QObject *parent=nullptr)
 Constructs a BoundSliderFactory instance.
 
int queryValue () const
 Gets the current slider value.
 
void setValue (int value)
 Sets the slider value (with bounds enforcement)
 

Protected Member Functions

virtual void _plain_set_value (int value)
 Internal method for setting values with bounds checking.
 

Protected Attributes

int current_value { default_value }
 
QSlider * monitoring_bar
 

Detailed Description

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
class BoundSliderFactory< default_value, min, max >

Factory class for creating bounded QSlider widgets.

This template class provides a convenient way to create and manage QSlider widgets with enforced value boundaries. It handles value clamping and synchronization between the internal state and the actual QSlider widget.

Template Parameters
default_valueThe default value for the slider (must be within min/max bounds)
minThe minimum allowed value (default 0)
maxThe maximum allowed value (default 100)

Constructor & Destructor Documentation

◆ BoundSliderFactory()

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
BoundSliderFactory< default_value, min, max >::BoundSliderFactory ( QSlider *  barWidget,
QObject *  parent = nullptr 
)
inlineexplicit

Constructs a BoundSliderFactory instance.

Parameters
barWidgetPointer to the QSlider widget to manage
parentParent QObject (optional)

Member Function Documentation

◆ _plain_set_value()

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
virtual void BoundSliderFactory< default_value, min, max >::_plain_set_value ( int  value)
inlineprotectedvirtual

Internal method for setting values with bounds checking.

Parameters
valueThe value to set
Note
This method handles the actual bounds enforcement and is used to work around Q_OBJECT limitations in template classes

Reimplemented in PageSwitchingLimiter.

◆ queryValue()

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
int BoundSliderFactory< default_value, min, max >::queryValue ( ) const
inline

Gets the current slider value.

Returns
The current bounded value

◆ setValue()

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
void BoundSliderFactory< default_value, min, max >::setValue ( int  value)
inline

Sets the slider value (with bounds enforcement)

Parameters
valueThe new value to set

Member Data Documentation

◆ current_value

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
int BoundSliderFactory< default_value, min, max >::current_value { default_value }
protected

The current bounded value

◆ monitoring_bar

template<ValueLimitType default_value, ValueLimitType min = 0, ValueLimitType max = 100>
QSlider* BoundSliderFactory< default_value, min, max >::monitoring_bar
protected

Pointer to the managed QSlider widget


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