Collections
StackView
A stack-based container that pushes and pops pages with transitions.
Example

Usage
Push and pop pages
StackView keeps a navigation stack of pages with transitions.
#include <FluentQt/Collections.h>
using namespace fluent::collections;
auto* stackView = new StackView(this);
stackView->setInitialItem(firstPage);
stackView->push(nextPage);
stackView->pop();
QObject::connect(stackView, &StackView::depthChanged,
status, updateStatus);import fluentqt
stack_view = fluentqt.StackView()
stack_view.setInitialOwnedItem(first_page)
stack_view.pushOwnedItem(next_page)
stack_view.pop()
stack_view.depthChanged.connect(update_status)API
DeclarationNo matching API members.
fluent::collections::StackView
Inherits QStackedWidget · FluentElement · QMLPlus
Stacked page host with push/pop navigation semantics.
Constructors
Properties
int depthNumber of pages currently in the stack.
Readdepth()NotifydepthChanged()QWidget* currentItemCurrently visible stack page.
ReadcurrentItem()NotifycurrentItemChanged()QWidget* initialItemInitial page inserted into the stack.
ReadinitialItem()WritesetInitialItem()NotifyinitialItemChanged()bool busyWhether a transition or navigation operation is running.
Readbusy()NotifybusyChanged()Qt::Orientation orientationPrimary layout or motion orientation.
Readorientation()WritesetOrientation()NotifyorientationChanged()bool transitionAnimationEnabledWhether stack transition animation is enabled.
ReadtransitionAnimationEnabled()WritesetTransitionAnimationEnabled()NotifytransitionAnimationEnabledChanged()int transitionDurationStack transition duration in milliseconds.
ReadtransitionDuration()WritesetTransitionDuration()NotifytransitionDurationChanged()StackViewTransitionType transitionTypeTransition effect used for stack navigation.
ReadtransitionType()WritesetTransitionType()NotifytransitionTypeChanged()fluent::WidgetOwnership defaultItemOwnershipDefault release policy for pages added through StackView APIs.
ReaddefaultItemOwnership()WritesetDefaultItemOwnership()NotifydefaultItemOwnershipChanged()
Methods
int depth() constNumber of pages currently in the stack.
QWidget* currentItem() constCurrently visible stack page.
QWidget* initialItem() constInitial page inserted into the stack.
bool busy() constWhether a transition or navigation operation is running.
Qt::Orientation orientation() constPrimary layout or motion orientation.
void setOrientation(Qt::Orientation orientation)Primary layout or motion orientation.
bool transitionAnimationEnabled() constWhether stack transition animation is enabled.
void setTransitionAnimationEnabled(bool enabled)Whether stack transition animation is enabled.
int transitionDuration() constStack transition duration in milliseconds.
void setTransitionDuration(int durationMs)Stack transition duration in milliseconds.
StackViewTransitionType transitionType() constTransition effect used for stack navigation.
void setTransitionType(StackViewTransitionType type)Transition effect used for stack navigation.
WidgetOwnership defaultItemOwnership() constDefault release policy for pages added through StackView APIs.
void setDefaultItemOwnership(WidgetOwnership ownership)Default release policy for pages added through StackView APIs.
void setInitialItem(QWidget* item)Initial page inserted into the stack.
bool setInitialItem(QWidget* item, WidgetOwnership ownership)Initial page inserted into the stack.
bool adoptWidget(QWidget* item, WidgetOwnership ownership = WidgetOwnership::Borrowed)Adds a page to StackView navigation tracking without taking ownership by default.
Signals
void depthChanged(int depth)Number of pages currently in the stack.
void currentItemChanged(QWidget* item)Currently visible stack page.
void initialItemChanged(QWidget* item)Initial page inserted into the stack.
void busyChanged(bool busy)Whether a transition or navigation operation is running.
void orientationChanged(Qt::Orientation orientation)Primary layout or motion orientation.
void transitionAnimationEnabledChanged(bool enabled)Whether stack transition animation is enabled.
void transitionDurationChanged(int durationMs)Stack transition duration in milliseconds.
void transitionTypeChanged(StackViewTransitionType type)Transition effect used for stack navigation.
void defaultItemOwnershipChanged(WidgetOwnership ownership)Default release policy for pages added through StackView APIs.
Enumerations
enum class StackViewItemStatusInactiveActivatingActiveDeactivating
enum class StackViewTransitionOperationPushPopReplaceClearNone
enum class StackViewTransitionTypeSlideFadeScaleFadeImmediate
Destructors
PySide6 additions
setInitialOwnedItem(page)Reset the stack to an Owned page, or clear it for ``None``.
setInitialBorrowedItem(page)Reset the stack to a page detached when it leaves the host.
setInitialReparentedItem(page)Reset the stack to a page restored to its current parent.
pushOwnedItem(page)Push an Owned page.
pushBorrowedItem(page)Push a page that becomes parentless after pop.
pushReparentedItem(page)Push a page restored to its current parent after pop.
pushOwnedItems(pages)Push multiple Owned pages in one native transition.
pushBorrowedItems(pages)Push multiple pages that become parentless when removed.
pushReparentedItems(pages)Push multiple pages restored to their current parents.
replaceOwnedItem(page)Replace the current page with an Owned page.
replaceBorrowedItem(page)Replace the current page with a Borrowed page.
replaceReparentedItem(page)Replace the current page with a Reparented page.
replaceOwnedItemAt(index, page)Replace a page at ``index`` with an Owned page.
replaceBorrowedItemAt(index, page)Replace a page at ``index`` with a Borrowed page.
replaceReparentedItemAt(index, page)Replace a page at ``index`` with a Reparented page.
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:QStackedWidget