Scrolling
ScrollView
A scrollable viewport with Fluent scrollbars and optional zoom.
Example

Usage
Content scrolling and zoom
A large content surface can scroll in both directions and zoom within configured bounds.
#include <FluentQt/Scrolling.h>
using namespace fluent::scrolling;
auto* scrollView = new ScrollView(this);
scrollView->setFixedSize(420, 240);
scrollView->setWidget(new ScrollViewDemoCanvas(
QSize(760, 520), "Content canvas"));
scrollView->setZoomMode(ScrollView::ZoomMode::Enabled);
scrollView->setMinZoomFactor(0.5);
scrollView->setMaxZoomFactor(2.0);
scrollView->setHorizontalScrollBarVisibility(
ScrollView::ScrollBarVisibility::Auto);
scrollView->setVerticalScrollBarVisibility(
ScrollView::ScrollBarVisibility::Auto);
connect(zoomInButton, &QPushButton::clicked,
scrollView, [scrollView] { scrollView->zoomBy(1.25, true); });
connect(zoomOutButton, &QPushButton::clicked,
scrollView, [scrollView] { scrollView->zoomBy(0.8, true); });
connect(resetButton, &QPushButton::clicked,
scrollView, [scrollView] { scrollView->resetZoom(true); });import fluentqt
from PySide6.QtCore import QSize
scroll_view = fluentqt.ScrollView()
scroll_view.setFixedSize(420, 240)
scroll_view.setOwnedContentWidget(
ScrollViewDemoCanvas(QSize(760, 520), "Content canvas")
)
scroll_view.setZoomMode(fluentqt.ScrollView.ZoomMode.Enabled)
scroll_view.setMinZoomFactor(0.5)
scroll_view.setMaxZoomFactor(2.0)
scroll_view.setHorizontalScrollBarVisibility(
fluentqt.ScrollView.ScrollBarVisibility.Auto
)
scroll_view.setVerticalScrollBarVisibility(
fluentqt.ScrollView.ScrollBarVisibility.Auto
)
zoom_in.clicked.connect(lambda: scroll_view.zoomBy(1.25, True))
zoom_out.clicked.connect(lambda: scroll_view.zoomBy(0.8, True))
reset.clicked.connect(lambda: scroll_view.resetZoom(True))API
DeclarationNo matching API members.
fluent::scrolling::ScrollView
Inherits QScrollArea · FluentElement · QMLPlus
Scrollable content host with Fluent scroll bars and optional zoom support.
Constructors
Properties
ScrollMode horizontalScrollModeHorizontal scrolling interaction mode.
ReadhorizontalScrollMode()WritesetHorizontalScrollMode()NotifyhorizontalScrollModeChanged()ScrollMode verticalScrollModeVertical scrolling interaction mode.
ReadverticalScrollMode()WritesetVerticalScrollMode()NotifyverticalScrollModeChanged()ScrollBarVisibility horizontalScrollBarVisibilityVisibility policy for the horizontal scrollbar.
ReadhorizontalScrollBarVisibility()WritesetHorizontalScrollBarVisibility()NotifyhorizontalScrollBarVisibilityChanged()ScrollBarVisibility verticalScrollBarVisibilityVisibility policy for the vertical scrollbar.
ReadverticalScrollBarVisibility()WritesetVerticalScrollBarVisibility()NotifyverticalScrollBarVisibilityChanged()ZoomMode zoomModeZoom interaction mode.
ReadzoomMode()WritesetZoomMode()NotifyzoomModeChanged()qreal zoomFactorCurrent zoom factor applied to content.
ReadzoomFactor()WritesetZoomFactor()NotifyzoomFactorChanged()qreal minZoomFactorMinimum allowed zoom factor.
ReadminZoomFactor()WritesetMinZoomFactor()NotifyminZoomFactorChanged()qreal maxZoomFactorMaximum allowed zoom factor.
ReadmaxZoomFactor()WritesetMaxZoomFactor()NotifymaxZoomFactorChanged()bool scrollChainingEnabledWhether boundary wheel input chains to an enclosing scroller (WinUI ScrollViewer.IsScrollChainingEnabled).
ReadisScrollChainingEnabled()WritesetScrollChainingEnabled()NotifyscrollChainingEnabledChanged()QWidget* contentWidgetWidget displayed inside the scroll viewport.
ReadcontentWidget()WritesetContentWidget()NotifycontentWidgetChanged()fluent::WidgetOwnership contentOwnershipRelease policy for the current content widget.
ReadcontentOwnership()NotifycontentOwnershipChanged()
Methods
void setWidget(QWidget* widget)Installs content using QScrollArea-compatible owned semantics.
QWidget* takeWidget()Removes and returns the current content without deleting it.
QWidget* contentWidget() constWidget displayed inside the scroll viewport.
WidgetOwnership contentOwnership() constRelease policy for the current content widget.
void setContentWidget(QWidget* widget)Widget displayed inside the scroll viewport.
bool setContentWidget(QWidget* widget, WidgetOwnership ownership)Installs content with an explicit release policy.
QWidget* takeContentWidget()Removes and returns content as a parentless caller-owned widget.
ScrollMode horizontalScrollMode() constHorizontal scrolling interaction mode.
void setHorizontalScrollMode(ScrollMode mode)Horizontal scrolling interaction mode.
ScrollMode verticalScrollMode() constVertical scrolling interaction mode.
void setVerticalScrollMode(ScrollMode mode)Vertical scrolling interaction mode.
ScrollBarVisibility horizontalScrollBarVisibility() constVisibility policy for the horizontal scrollbar.
void setHorizontalScrollBarVisibility(ScrollBarVisibility visibility)Visibility policy for the horizontal scrollbar.
ScrollBarVisibility verticalScrollBarVisibility() constVisibility policy for the vertical scrollbar.
void setVerticalScrollBarVisibility(ScrollBarVisibility visibility)Visibility policy for the vertical scrollbar.
ZoomMode zoomMode() constZoom interaction mode.
void setZoomMode(ZoomMode mode)Zoom interaction mode.
qreal zoomFactor() constCurrent zoom factor applied to content.
void setZoomFactor(qreal factor)Current zoom factor applied to content.
qreal minZoomFactor() constMinimum allowed zoom factor.
void setMinZoomFactor(qreal factor)Minimum allowed zoom factor.
qreal maxZoomFactor() constMaximum allowed zoom factor.
void setMaxZoomFactor(qreal factor)Maximum allowed zoom factor.
bool isScrollChainingEnabled() constWhether boundary wheel input chains to an enclosing scroller (WinUI ScrollViewer.IsScrollChainingEnabled).
void setScrollChainingEnabled(bool enabled)Whether boundary wheel input chains to an enclosing scroller (WinUI ScrollViewer.IsScrollChainingEnabled).
Signals
void horizontalScrollModeChanged()Horizontal scrolling interaction mode.
void verticalScrollModeChanged()Vertical scrolling interaction mode.
void horizontalScrollBarVisibilityChanged()Visibility policy for the horizontal scrollbar.
void verticalScrollBarVisibilityChanged()Visibility policy for the vertical scrollbar.
void zoomModeChanged()Zoom interaction mode.
void zoomFactorChanged()Current zoom factor applied to content.
void minZoomFactorChanged()Minimum allowed zoom factor.
void maxZoomFactorChanged()Maximum allowed zoom factor.
void scrollChainingEnabledChanged()Whether boundary wheel input chains to an enclosing scroller (WinUI ScrollViewer.IsScrollChainingEnabled).
void contentWidgetChanged(QWidget* widget)Widget displayed inside the scroll viewport.
void contentOwnershipChanged(WidgetOwnership ownership)Release policy for the current content widget.
Enumerations
enum class ScrollModeDisabledEnabledAuto
enum class ScrollBarVisibilityDisabledAutoVisibleHidden
enum class ZoomModeDisabledEnabled
Destructors
PySide6 additions
setOwnedContentWidget(widget)Install content that is deleted when it leaves the host.
setBorrowedContentWidget(widget)Install content that becomes parentless when it leaves the host.
setReparentedContentWidget(widget)Install content that returns to its current QWidget parent.
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:QScrollArea
fluent::scrolling::ScrollViewZoomAware
Helper content widget that exposes ScrollView zoom state to layout code.