Collections
FlowView
Lays out variable-sized items in wrapping rows, like a tag cloud.
Example

Usage
Network photo flow
Images load asynchronously while the flow layout wraps cards across rows.
#include <FluentQt/Collections.h>
using namespace fluent::collections;
auto* flowView = new FlowView(this);
flowView->setDefaultItemSize(QSize(160, 118));
flowView->setItemDelegate(photoDelegate);
flowView->setModel(model);
flowView->setSelectionMode(FlowView::SelectionMode::Single);import fluentqt
from PySide6.QtCore import QSize
flow_view = fluentqt.FlowView()
flow_view.setSelectionMode(fluentqt.SelectionMode.Single)
flow_view.setDefaultItemSize(QSize(160, 118))
flow_view.setItemDelegate(photo_delegate)
flow_view.setModel(model)API
DeclarationNo matching API members.
fluent::collections::FlowView
Inherits QAbstractItemView · FluentElement · QMLPlus
Fluent collection view that wraps items across rows or columns.
Constructors
Properties
SelectionMode selectionModeSelection mode used by the collection view.
ReadselectionMode()WritesetSelectionMode()NotifyselectionModeChanged()Typography::FontRole fontRoleFluent typography role used for text rendering.
ReadfontRole()WritesetFontRole()NotifyfontRoleChanged()bool borderVisibleWhether the control frame border is painted.
ReadborderVisible()WritesetBorderVisible()NotifyborderVisibleChanged()QString headerTextConvenience text displayed in the header area.
ReadheaderText()WritesetHeaderText()NotifyheaderTextChanged()QString placeholderTextText shown when the flow model has no items to present.
ReadplaceholderText()WritesetPlaceholderText()NotifyplaceholderTextChanged()QSize defaultItemSizeDefault item size used when the model does not provide one.
ReaddefaultItemSize()WritesetDefaultItemSize()NotifydefaultItemSizeChanged()QSize minimumItemSizeMinimum item size allowed by the flow layout.
ReadminimumItemSize()WritesetMinimumItemSize()NotifyminimumItemSizeChanged()QSize maximumItemSizeMaximum item size allowed by the flow layout.
ReadmaximumItemSize()WritesetMaximumItemSize()NotifymaximumItemSizeChanged()int itemSizeRoleModel role used to resolve per-item size.
ReaditemSizeRole()WritesetItemSizeRole()NotifyitemSizeRoleChanged()int horizontalSpacingHorizontal spacing between items.
ReadhorizontalSpacing()WritesetHorizontalSpacing()NotifyhorizontalSpacingChanged()int verticalSpacingVertical spacing between items.
ReadverticalSpacing()WritesetVerticalSpacing()NotifyverticalSpacingChanged()QMargins contentMarginsMargins applied around the control content area.
ReadcontentMargins()WritesetContentMargins()NotifycontentMarginsChanged()bool viewportHoveredWhether the item-view viewport is currently hovered.
ReadviewportHovered()NotifyviewportHoveredChanged()bool canReorderItemsWhether drag reordering is enabled.
ReadcanReorderItems()WritesetCanReorderItems()NotifycanReorderItemsChanged()bool scrollChainingEnabledWhether boundary wheel input may continue to an enclosing scroller.
ReadisScrollChainingEnabled()WritesetScrollChainingEnabled()NotifyscrollChainingEnabledChanged()bool overscrollEnabledWhether the view shows an elastic overscroll/bounce at the scroll boundary. Enabled by default; disable for chrome that should stop cleanly at the edge.
ReadisOverscrollEnabled()WritesetOverscrollEnabled()NotifyoverscrollEnabledChanged()
Methods
SelectionMode selectionMode() constSelection mode used by the collection view.
void setSelectionMode(SelectionMode mode)Selection mode used by the collection view.
Typography::FontRole fontRole() constFluent typography role used for text rendering.
void setFontRole(Typography::FontRole role)Fluent typography role used for text rendering.
bool borderVisible() constWhether the control frame border is painted.
void setBorderVisible(bool visible)Whether the control frame border is painted.
QString headerText() constConvenience text displayed in the header area.
void setHeaderText(const QString& text)Convenience text displayed in the header area.
QString placeholderText() constText shown when the flow model has no items to present.
void setPlaceholderText(const QString& text)Text shown when the flow model has no items to present.
QSize defaultItemSize() constDefault item size used when the model does not provide one.
void setDefaultItemSize(const QSize& size)Default item size used when the model does not provide one.
QSize minimumItemSize() constMinimum item size allowed by the flow layout.
void setMinimumItemSize(const QSize& size)Minimum item size allowed by the flow layout.
QSize maximumItemSize() constMaximum item size allowed by the flow layout.
void setMaximumItemSize(const QSize& size)Maximum item size allowed by the flow layout.
int itemSizeRole() constModel role used to resolve per-item size.
void setItemSizeRole(int role)Model role used to resolve per-item size.
int horizontalSpacing() constHorizontal spacing between items.
void setHorizontalSpacing(int spacing)Horizontal spacing between items.
int verticalSpacing() constVertical spacing between items.
void setVerticalSpacing(int spacing)Vertical spacing between items.
QMargins contentMargins() constMargins applied around the control content area.
void setContentMargins(const QMargins& margins)Margins applied around the control content area.
bool viewportHovered() constWhether the item-view viewport is currently hovered.
bool canReorderItems() constWhether drag reordering is enabled.
void setCanReorderItems(bool enabled)Whether drag reordering is enabled.
bool isScrollChainingEnabled() constWhether boundary wheel input may continue to an enclosing scroller.
void setScrollChainingEnabled(bool enabled)Whether boundary wheel input may continue to an enclosing scroller.
bool isOverscrollEnabled() constWhether the view shows an elastic overscroll/bounce at the scroll boundary. Enabled by default; disable for chrome that should stop cleanly at the edge.
void setOverscrollEnabled(bool enabled)Whether the view shows an elastic overscroll/bounce at the scroll boundary. Enabled by default; disable for chrome that should stop cleanly at the edge.
Signals
void selectionModeChanged()Selection mode used by the collection view.
void fontRoleChanged()Fluent typography role used for text rendering.
void borderVisibleChanged()Whether the control frame border is painted.
void headerTextChanged()Convenience text displayed in the header area.
void placeholderTextChanged()Text shown when the flow model has no items to present.
void defaultItemSizeChanged()Default item size used when the model does not provide one.
void minimumItemSizeChanged()Minimum item size allowed by the flow layout.
void maximumItemSizeChanged()Maximum item size allowed by the flow layout.
void itemSizeRoleChanged()Model role used to resolve per-item size.
void horizontalSpacingChanged()Horizontal spacing between items.
void verticalSpacingChanged()Vertical spacing between items.
void contentMarginsChanged()Margins applied around the control content area.
void viewportHoveredChanged()Whether the item-view viewport is currently hovered.
void canReorderItemsChanged()Whether drag reordering is enabled.
void scrollChainingEnabledChanged()Whether boundary wheel input may continue to an enclosing scroller.
void overscrollEnabledChanged()Whether the view shows an elastic overscroll/bounce at the scroll boundary. Enabled by default; disable for chrome that should stop cleanly at the edge.
void itemClicked(int row)Emits the row once for the same pointer action as inherited clicked().
Types and aliases
Destructors
PySide6 additions
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:QAbstractItemView