Collections
TreeView
A control that presents hierarchical data with expandable nodes.
Example

Usage
Folder hierarchy
The essential tree: click a chevron to expand or collapse a folder, and selecting a row shows the accent indicator. A custom delegate paints the rotating chevron and per-row icon glyph.
#include <FluentQt/Collections.h>
using namespace fluent::collections;
auto* tree = new TreeView(this);
tree->setItemDelegate(new TreeRowDelegate(
themeHost, rowHeight, tree, tree));
tree->setModel(model);
tree->setAccessibleName("Folders");
tree->expandAll();import fluentqt
tree = fluentqt.TreeView()
tree.setAccessibleName('Folders')
tree.setItemDelegate(row_delegate)
tree.setModel(model)
tree.expandAll()API
DeclarationNo matching API members.
fluent::collections::TreeView
Inherits QTreeView · FluentElement · QMLPlus
Fluent tree collection view with hierarchy-aware selection visuals.
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 viewportHoveredWhether the item-view viewport is currently hovered.
ReadviewportHovered()NotifyviewportHoveredChanged()qreal indicatorMotionProgressAnimated progress of the tree selection indicator.
ReadindicatorMotionProgress()NotifyindicatorMotionProgressChanged()IndicatorVerticalDirection indicatorMotionDirectionVertical direction used by tree indicator motion.
ReadindicatorMotionDirection()NotifyindicatorMotionDirectionChanged()IndicatorHierarchyTransition indicatorHierarchyTransitionHierarchy transition mode used by tree indicator motion.
ReadindicatorHierarchyTransition()NotifyindicatorHierarchyTransitionChanged()bool indicatorMotionAnimationEnabledWhether tree indicator motion animation is enabled.
ReadisIndicatorMotionAnimationEnabled()WritesetIndicatorMotionAnimationEnabled()NotifyindicatorMotionAnimationEnabledChanged()bool horizontalFluentScrollBarEnabledWhether the Fluent horizontal scroll overlay is allowed to appear.
ReadisHorizontalFluentScrollBarEnabled()WritesetHorizontalFluentScrollBarEnabled()bool borderVisibleWhether the control frame border is painted.
ReadborderVisible()WritesetBorderVisible()NotifyborderVisibleChanged()bool backgroundVisibleWhether the control background is painted.
ReadbackgroundVisible()WritesetBackgroundVisible()NotifybackgroundVisibleChanged()QString headerTextConvenience text displayed in the header area.
ReadheaderText()WritesetHeaderText()NotifyheaderTextChanged()QString placeholderTextText shown when the tree model has no rows to present.
ReadplaceholderText()WritesetPlaceholderText()NotifyplaceholderTextChanged()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 (e.g. a navigation pane) that should stop cleanly at the edge so reversing the wheel scrolls again immediately.
ReadisOverscrollEnabled()WritesetOverscrollEnabled()NotifyoverscrollEnabledChanged()
Methods
SelectionMode selectionMode() const--- Selection ---
void setSelectionMode(SelectionMode mode)Selection mode used by the collection view.
Typography::FontRole fontRole() const--- Appearance ---
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.
bool backgroundVisible() constWhether the control background is painted.
void setBackgroundVisible(bool visible)Whether the control background 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 tree model has no rows to present.
void setPlaceholderText(const QString& text)Text shown when the tree model has no rows to present.
bool viewportHovered() constWhether the item-view viewport is currently hovered.
bool canReorderItems() const--- Drag reorder ---
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 (e.g. a navigation pane) that should stop cleanly at the edge so reversing the wheel scrolls again immediately.
void setOverscrollEnabled(bool enabled)Whether the view shows an elastic overscroll/bounce at the scroll boundary. Enabled by default; disable for chrome (e.g. a navigation pane) that should stop cleanly at the edge so reversing the wheel scrolls again immediately.
void expandAll()--- Tree API ---
QModelIndex selectedItem() const--- Selection API ---
qreal indicatorMotionProgress() const--- Selected indicator motion API ---
IndicatorVerticalDirection indicatorMotionDirection() constVertical direction used by tree indicator motion.
IndicatorHierarchyTransition indicatorHierarchyTransition() constHierarchy transition mode used by tree indicator motion.
bool isIndicatorMotionAnimationEnabled() constWhether tree indicator motion animation is enabled.
void setIndicatorMotionAnimationEnabled(bool enabled)Whether tree indicator motion animation is enabled.
QRectF selectedIndicatorRect() const--- Selected indicator pill rendering ---
QRectF selectedIndicatorRect(qreal progress) constReturns selected indicator geometry for a normalized transition progress.
SelectionIndicatorStyle selectionIndicatorStyle() constReturns the style used by the selected indicator overlay.
void setSelectionIndicatorStyle(const SelectionIndicatorStyle& style)Sets the style used by the selected indicator overlay.
bool selectionIndicatorVisible() constWhether the Fluent accent selection-indicator overlay is visible.
qreal selectionIndicatorHeight() constReturns the height of the Fluent selection-indicator pill.
void setSelectionIndicatorHeight(qreal height)Sets the height of the Fluent selection-indicator pill.
bool isHorizontalFluentScrollBarEnabled() constReturns whether the Fluent horizontal scroll overlay may be shown.
void setHorizontalFluentScrollBarEnabled(bool enabled)Enables or disables the Fluent horizontal scroll overlay.
qreal chevronRotation(const QModelIndex& index) constQuery chevron rotation progress for delegate painting. 0=right, 1=down.
Signals
void selectionModeChanged()Selection mode used by the collection view.
void fontRoleChanged()Fluent typography role used for text rendering.
void viewportHoveredChanged()Whether the item-view viewport is currently hovered.
void borderVisibleChanged()Whether the control frame border is painted.
void backgroundVisibleChanged()Whether the control background is painted.
void headerTextChanged()Convenience text displayed in the header area.
void placeholderTextChanged()Text shown when the tree model has no rows to present.
void itemPressed(const QModelIndex& index)Mirrors the inherited pressed() signal for the same model index.
void itemClicked(const QModelIndex& index)Mirrors the inherited clicked() signal for the same model index.
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 (e.g. a navigation pane) that should stop cleanly at the edge so reversing the wheel scrolls again immediately.
void indicatorMotionProgressChanged()Animated progress of the tree selection indicator.
void indicatorMotionDirectionChanged()Vertical direction used by tree indicator motion.
void indicatorHierarchyTransitionChanged()Hierarchy transition mode used by tree indicator motion.
void indicatorMotionAnimationEnabledChanged()Whether tree indicator motion animation is enabled.
Enumerations
enum class IndicatorVerticalDirectionNoneUpDown
enum class IndicatorHierarchyTransitionNoneSameLevelInwardOutward
Types and aliases
struct SelectionIndicatorStyleStyle parameters used by the moving selection indicator overlay.
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:QTreeView
fluent::collections::TreeView::SelectionIndicatorStyle
Style parameters used by the moving selection indicator overlay.