Workspace 6.21.5
Public Slots | Signals | Public Member Functions | List of all members
RangedSlider Class Reference

#include <Workspace/Widgets/rangedslider.h>

Inherits QSlider.

Public Slots

void checkEnds ()
 
void setMaximumSlot (int val)
 
void setMinimumSlot (int val)
 
void setStepSlot (int val)
 

Signals

void atEnd ()
 
void atStart ()
 

Public Member Functions

 RangedSlider (QWidget *parent=nullptr)
 

Constructor & Destructor Documentation

◆ RangedSlider()

RangedSlider ( QWidget *  parent = nullptr)

The constructor connects the slider's valueChanged() signal to the checkEnds() slot, so client code does not need to do this for themselves. This ensures that the atStart() and atEnd() signals are emitted appropriately without any special action by client code.

Member Function Documentation

◆ atEnd

void atEnd ( )
signal

This signal will be emitted if either the value or the maximum is changed and as a result, value() == maximum().

◆ atStart

void atStart ( )
signal

This signal will be emitted if either the value or the minimum is changed and as a result, value() == minimum().

◆ checkEnds

void checkEnds ( )
slot

Causes the atStart() and/or atEnd() signals to be emitted if the current value is set to the minimum or maximum respectively. If the minimum and maximum are the same, both signals will be emitted, atStart() then atEnd().

◆ setMaximumSlot

void setMaximumSlot ( int  val)
slot
Parameters
valThe new maximum for the range.

Apart from calling QSlider::setMaximum(), this function also ensures that atEnd() is emitted if the result of setting the maximum to val causes the current value to be set to val.

◆ setMinimumSlot

void setMinimumSlot ( int  val)
slot
Parameters
valThe new minimum for the range.

Apart from calling QSlider::setMinimum(), this function also ensures that atStart() is emitted if the result of setting the minimum to val causes the current value to be set to val.

◆ setStepSlot

void setStepSlot ( int  val)
slot
Parameters
valThe new step size to use.

This function simply forwards to QSlider::setSingleStep(). It exists only because setSingleStep() is not a slot and sometimes widgets want to modify the step size dynamically.