Collections
DrawerView
A panel that slides in from a window edge over the content.
Example

Usage
Right-edge drawer
The drawer slides over the hosting surface and dismisses on outside click.
#include <FluentQt/Collections.h>
using namespace fluent::collections;
auto* drawer = new DrawerView(host);
drawer->setEdge(DrawerView::DrawerEdge::Right);
drawer->setDrawerLength(260);
drawer->setContentWidget(settingsPanel, WidgetOwnership::Owned);
auto* openButton = new Button("Open drawer", host);
QObject::connect(openButton, &Button::clicked,
drawer, &DrawerView::open);import fluentqt
drawer = fluentqt.DrawerView(host)
drawer.setEdge(fluentqt.DrawerView.DrawerEdge.Right)
drawer.setDrawerLength(260)
drawer.setOwnedContentWidget(settings_panel)
open_button = fluentqt.Button("Open drawer", host)
open_button.clicked.connect(drawer.open)API
DeclarationNo matching API members.
fluent::collections::DrawerView
Inherits QWidget · FluentElement · QMLPlus
Same-window drawer overlay with modal, dim, and drag behavior.
Constructors
Properties
bool isOpenWhether the popup, drawer, or notification surface is open.
ReadisOpen()WritesetIsOpen()NotifyisOpenChanged()DrawerEdge edgeWindow edge from which the drawer appears.
Readedge()WritesetEdge()NotifyedgeChanged()qreal positionAnimated drawer position along its opening axis.
Readposition()WritesetPosition()NotifypositionChanged()int drawerLengthDrawer length measured along the opening axis.
ReaddrawerLength()WritesetDrawerLength()NotifydrawerLengthChanged()QMargins availableMarginsMargins removed from the owning window before drawer placement.
ReadavailableMargins()WritesetAvailableMargins()NotifyavailableMarginsChanged()bool modalWhether the overlay blocks interaction outside itself.
ReadisModal()WritesetModal()NotifymodalChanged()bool dimWhether a dim/scrim layer is shown behind the overlay.
ReadisDim()WritesetDim()NotifydimChanged()double dimOpacityScrim opacity in [0, 1]; -1 uses the theme smoke token when dim is enabled.
ReaddimOpacity()WritesetDimOpacity()NotifydimOpacityChanged()double backdropBlurRadiusCached owning-window blur radius in logical pixels [0, 32]; 0 disables blur.
ReadbackdropBlurRadius()WritesetBackdropBlurRadius()NotifybackdropBlurRadiusChanged()ClosePolicy closePolicyPolicy controlling outside-click, escape, or programmatic close behavior.
ReadclosePolicy()WritesetClosePolicy()NotifyclosePolicyChanged()bool interactiveWhether pointer dragging can interact with the drawer.
ReadisInteractive()WritesetInteractive()NotifyinteractiveChanged()int dragMarginEdge margin used to begin drawer dragging.
ReaddragMargin()WritesetDragMargin()NotifydragMarginChanged()int outerCornerRadiusCorner radius used on the drawer outer edge.
ReadouterCornerRadius()WritesetOuterCornerRadius()NotifyouterCornerRadiusChanged()bool animationEnabledWhether drawer open/close transitions are animated.
ReadisAnimationEnabled()WritesetAnimationEnabled()NotifyanimationEnabledChanged()QWidget* contentWidgetWidget hosted inside the drawer panel.
ReadcontentWidget()WritesetContentWidget()NotifycontentWidgetChanged()fluent::WidgetOwnership contentOwnershipRelease policy for the current content widget.
ReadcontentOwnership()NotifycontentOwnershipChanged()
Methods
bool isOpen() constWhether the popup, drawer, or notification surface is open.
void setIsOpen(bool open)Whether the popup, drawer, or notification surface is open.
DrawerEdge edge() constWindow edge from which the drawer appears.
void setEdge(DrawerEdge edge)Window edge from which the drawer appears.
qreal position() constAnimated drawer position along its opening axis.
void setPosition(qreal position)Animated drawer position along its opening axis.
int drawerLength() constDrawer length measured along the opening axis.
void setDrawerLength(int length)Drawer length measured along the opening axis.
QMargins availableMargins() constMargins removed from the owning window before drawer placement.
void setAvailableMargins(const QMargins& margins)Margins removed from the owning window before drawer placement.
bool isModal() constWhether the overlay blocks interaction outside itself.
void setModal(bool modal)Whether the overlay blocks interaction outside itself.
bool isDim() constWhether a dim/scrim layer is shown behind the overlay.
void setDim(bool dim)Whether a dim/scrim layer is shown behind the overlay.
double dimOpacity() constScrim opacity in [0, 1]; -1 uses the theme smoke token when dim is enabled.
void setDimOpacity(double opacity)Scrim opacity in [0, 1]; -1 uses the theme smoke token when dim is enabled.
double backdropBlurRadius() constCached owning-window blur radius in logical pixels [0, 32]; 0 disables blur.
void setBackdropBlurRadius(double radius)Cached owning-window blur radius in logical pixels [0, 32]; 0 disables blur.
void refreshBackdrop()Recaptures the owning-window content after background changes.
ClosePolicy closePolicy() constPolicy controlling outside-click, escape, or programmatic close behavior.
void setClosePolicy(ClosePolicy policy)Policy controlling outside-click, escape, or programmatic close behavior.
bool isInteractive() constWhether pointer dragging can interact with the drawer.
void setInteractive(bool interactive)Whether pointer dragging can interact with the drawer.
int dragMargin() constEdge margin used to begin drawer dragging.
void setDragMargin(int margin)Edge margin used to begin drawer dragging.
int outerCornerRadius() constCorner radius used on the drawer outer edge.
void setOuterCornerRadius(int radius)Corner radius used on the drawer outer edge.
bool isAnimationEnabled() constWhether drawer open/close transitions are animated.
void setAnimationEnabled(bool enabled)Whether drawer open/close transitions are animated.
QWidget* contentWidget() constWidget hosted inside the drawer panel.
void setContentWidget(QWidget* widget)Hosts content with Borrowed release semantics.
bool setContentWidget(QWidget* widget, WidgetOwnership ownership)Hosts content with an explicit release policy.
QWidget* takeContentWidget()Removes and returns content as a parentless caller-owned widget.
WidgetOwnership contentOwnership() constRelease policy for the current content widget.
Signals
void isOpenChanged(bool open)Whether the popup, drawer, or notification surface is open.
void edgeChanged(DrawerEdge edge)Window edge from which the drawer appears.
void positionChanged(qreal position)Animated drawer position along its opening axis.
void drawerLengthChanged(int length)Drawer length measured along the opening axis.
void availableMarginsChanged(const QMargins& margins)Margins removed from the owning window before drawer placement.
void modalChanged(bool modal)Whether the overlay blocks interaction outside itself.
void dimChanged(bool dim)Whether a dim/scrim layer is shown behind the overlay.
void dimOpacityChanged(double opacity)Scrim opacity in [0, 1]; -1 uses the theme smoke token when dim is enabled.
void backdropBlurRadiusChanged(double radius)Cached owning-window blur radius in logical pixels [0, 32]; 0 disables blur.
void closePolicyChanged(ClosePolicy policy)Policy controlling outside-click, escape, or programmatic close behavior.
void interactiveChanged(bool interactive)Whether pointer dragging can interact with the drawer.
void dragMarginChanged(int margin)Edge margin used to begin drawer dragging.
void outerCornerRadiusChanged(int radius)Corner radius used on the drawer outer edge.
void animationEnabledChanged(bool enabled)Whether drawer open/close transitions are animated.
void contentWidgetChanged(QWidget* widget)Widget hosted inside the drawer panel.
void contentOwnershipChanged(WidgetOwnership ownership)Release policy for the current content widget.
Enumerations
enum class DrawerEdgeLeftRightTopBottom
enum CloseFlagNoAutoClose = 0CloseOnPressOutside = 1 << 0CloseOnEscape = 1 << 1
Types and aliases
Destructors
PySide6 additions
setOwnedContentWidget(widget)Install content that is deleted when it leaves the drawer.
setBorrowedContentWidget(widget)Install content that becomes parentless when released.
setReparentedContentWidget(widget)Install content restored 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:QWidget