Basic input
RangeSlider
Lets people select a lower and an upper value by dragging two thumbs along a track.
Example

Usage
Range slider live values
Drag either thumb to select a range and mirror both values in external UI.
#include <FluentQt/BasicInput.h>
using namespace fluent::basicinput;
auto* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(8);
auto* slider = new RangeSlider(Qt::Horizontal, this);
slider->setAccessibleName("Price range");
slider->setRange(0, 100);
slider->setValues(20, 64);
slider->setMaximumWidth(260);
auto* status = new Label("Range: 20 to 64", this);
layout->addWidget(slider);
layout->addWidget(status);
connect(slider, &RangeSlider::valuesChanged,
status, [status](int lower, int upper) {
status->setText(QString("Range: %1 to %2").arg(lower).arg(upper));
});import fluentqt
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QVBoxLayout
layout = QVBoxLayout(root)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(8)
slider = fluentqt.RangeSlider(Qt.Orientation.Horizontal)
slider.setAccessibleName('Price range')
slider.setRange(0, 100)
slider.setValues(20, 64)
slider.setMaximumWidth(260)
status = fluentqt.Label('Range: 20 to 64')
slider.valuesChanged.connect(
lambda lower, upper: status.setText(f"Range: {lower} to {upper}")
)
layout.addWidget(slider)
layout.addWidget(status)API
DeclarationNo matching API members.
fluent::basicinput::RangeSlider
Inherits QWidget · FluentElement · QMLPlus
Fluent two-thumb slider that selects a lower and an upper value.
Constructors
Properties
Qt::Orientation orientationTrack orientation; vertical sliders place the minimum at the bottom.
Readorientation()WritesetOrientation()NotifyorientationChanged()int minimumSmallest selectable value.
Readminimum()WritesetMinimum()NotifyrangeChanged()int maximumLargest selectable value.
Readmaximum()WritesetMaximum()NotifyrangeChanged()int lowerValueCommitted lower value.
ReadlowerValue()WritesetLowerValue()NotifylowerValueChanged()int upperValueCommitted upper value.
ReadupperValue()WritesetUpperValue()NotifyupperValueChanged()int minimumRangeSmallest allowed distance between the two values; 0 lets the thumbs meet.
ReadminimumRange()WritesetMinimumRange()NotifyminimumRangeChanged()int singleStepArrow-key step.
ReadsingleStep()WritesetSingleStep()NotifysingleStepChanged()int pageStepPage Up and Page Down step.
ReadpageStep()WritesetPageStep()NotifypageStepChanged()QSlider::TickPosition tickPositionTick placement; ticks appear while the pointer is over the control.
ReadtickPosition()WritesetTickPosition()NotifytickPositionChanged()int tickIntervalTick spacing in values; 0 derives it from the steps as QSlider does.
ReadtickInterval()WritesetTickInterval()NotifytickIntervalChanged()bool trackingWhether values commit while dragging; when false they commit on release.
ReadhasTracking()WritesetTracking()NotifytrackingChanged()Thumb activeThumbThumb that receives keyboard input and paints above the other.
ReadactiveThumb()WritesetActiveThumb()NotifyactiveThumbChanged()
Methods
Qt::Orientation orientation() constTrack orientation; vertical sliders place the minimum at the bottom.
void setOrientation(Qt::Orientation orientation)Track orientation; vertical sliders place the minimum at the bottom.
int minimum() constSmallest selectable value.
void setMinimum(int minimum)Smallest selectable value.
int maximum() constLargest selectable value.
void setMaximum(int maximum)Largest selectable value.
void setRange(int minimum, int maximum)Sets both bounds; a maximum below the minimum becomes the minimum.
int lowerValue() constCommitted lower value.
void setLowerValue(int value)Committed lower value.
int upperValue() constCommitted upper value.
void setUpperValue(int value)Committed upper value.
void setValues(int lower, int upper)Sets both values at once, ordering them and applying minimumRange.
int lowerPosition() constVisual lower position; differs from lowerValue only while dragging without tracking.
int upperPosition() constVisual upper position; differs from upperValue only while dragging without tracking.
int minimumRange() constSmallest allowed distance between the two values; 0 lets the thumbs meet.
void setMinimumRange(int range)Smallest allowed distance between the two values; 0 lets the thumbs meet.
int singleStep() constArrow-key step.
void setSingleStep(int step)Arrow-key step.
int pageStep() constPage Up and Page Down step.
void setPageStep(int step)Page Up and Page Down step.
QSlider::TickPosition tickPosition() constTick placement; ticks appear while the pointer is over the control.
void setTickPosition(QSlider::TickPosition position)Tick placement; ticks appear while the pointer is over the control.
int tickInterval() constTick spacing in values; 0 derives it from the steps as QSlider does.
void setTickInterval(int interval)Tick spacing in values; 0 derives it from the steps as QSlider does.
bool hasTracking() constWhether values commit while dragging; when false they commit on release.
void setTracking(bool enabled)Whether values commit while dragging; when false they commit on release.
Thumb activeThumb() constThumb that receives keyboard input and paints above the other.
void setActiveThumb(Thumb thumb)Thumb that receives keyboard input and paints above the other.
bool isSliderDown() constWhether a thumb is being dragged.
QPoint thumbCenter(Thumb thumb) constThumb center in widget coordinates, for layout and accessibility.
Signals
void orientationChanged(Qt::Orientation orientation)Track orientation; vertical sliders place the minimum at the bottom.
void rangeChanged(int minimum, int maximum)Smallest selectable value.
void lowerValueChanged(int value)Committed lower value.
void upperValueChanged(int value)Committed upper value.
void valuesChanged(int lower, int upper)Emitted once after either committed value changes.
void minimumRangeChanged(int range)Smallest allowed distance between the two values; 0 lets the thumbs meet.
void singleStepChanged(int step)Arrow-key step.
void pageStepChanged(int step)Page Up and Page Down step.
void tickPositionChanged(QSlider::TickPosition position)Tick placement; ticks appear while the pointer is over the control.
void tickIntervalChanged(int interval)Tick spacing in values; 0 derives it from the steps as QSlider does.
void trackingChanged(bool enabled)Whether values commit while dragging; when false they commit on release.
void activeThumbChanged(Thumb thumb)Thumb that receives keyboard input and paints above the other.
void sliderPressed()Emitted when a pointer press starts a drag.
void sliderMoved(int lower, int upper)Emitted when a dragged position moves, whether or not tracking is enabled.
void sliderReleased()Emitted once when the drag ends, after the final values commit.
Enumerations
enum class ThumbIdentifies one of the two thumbs.
LowerUpper
Destructors
Subclass interfaces
Methods
Inherited from fluent::FluentElement
Methods
static void setTheme(Theme theme)Updates the global theme and notifies active FluentElement instances.
static void setThemeDeferred(Theme theme)Schedules a visible-first batched theme refresh without blocking the current interaction.
static Theme currentTheme()Returns the currently active global theme.
static bool themeUsesDarkAppearance(Theme theme)Returns whether a theme uses dark-backed chrome and material tokens.
static void refreshTheme()Re-broadcasts the current theme to repaint after a design-token change.
static int themeGeneration()Monotonic counter bumped on every theme change, for staleness checks.
Theme effectiveTheme() constResolves the theme used by this element, honoring an inherited QWidget override.
bool effectiveThemeUsesDarkAppearance() constReturns whether this element's effective theme uses dark-backed chrome.
bool setThemeOverrides(const QJsonObject& overrides)Component-facing token accessors.
QJsonObject themeOverrides() constReturns this element's authored overrides.
void clearThemeOverrides()Restores all token fields to global theme defaults.
const Colors& themeColorsRef() constNon-copying access to the active color set (for hot paint paths).
Material::AcrylicToken themeAcrylic() constMaterial, elevation, and adaptive layout tokens.
QColor themeBackdrop(bool active) constWindow-chrome backdrop color for the given activation state.
virtual void onThemeUpdated()Called after the global theme changes.
Enumerations
enum ThemeGlobal visual theme used when resolving design tokens.
Light = 0Dark = 1HighContrast = 2
Types and aliases
struct ColorsDesign token snapshots returned to components.
Inherited from fluent::QMLPlus
Methods
AnchorLayout::Anchors* anchors()Returns mutable anchors for the QWidget host.
void setState(const QString& name)Applies a named state, or clears state when name is empty.
void addState(const QMLState& state)Registers or replaces a named state definition.
void evaluateStates()Reevaluates conditions; the first registered true condition wins.
QMLPlusRuntime* runtime()Returns the lazy host-owned state observation object.
void setAnchors(const AnchorLayout::Anchors& anchors)Replaces all host anchors and invalidates the parent layout.
void resetAnchors()Clears all host anchors and invalidates the parent layout.
void bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)Binds a source property to a property on the QWidget host.
BindingHandle bindManaged(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction direction = PropertyBinder::OneWay, BindingOptions options = {})Installs a managed direct binding on this QWidget host.
BindingHandle bindComputed(const char* targetProp, const QVector<BindingDependency>& dependencies, std::function<QVariant()> evaluate, BindingOptions options = {})Installs an explicit-dependency C++ expression on this QWidget host.
void addTransition(const StateTransition& transition)Registers a state transition in precedence order.
void setBehavior(const char* propertyName, const PropertyAnimation& animation)Sets the default animation for this host's managed property writes.
void clearBehavior(const char* propertyName)Removes the default animation for future managed writes.
bool writeProperty(const char* propertyName, const QVariant& value)Writes a host property through Behavior without removing its binding.
All inherited Qt members:QWidget