Dialogs & flyouts
Flyout
A light-dismiss container anchored to the control that opened it.
Example

Usage
Anchored placement
Flyout positions itself around an anchor and can fall back automatically near edges.
#include <FluentQt/DialogsFlyouts.h>
using namespace fluent::dialogs_flyouts;
auto* flyout = new Flyout(window());
flyout->setPlacement(Flyout::Right);
populateFlyout(flyout);
connect(flyout, &Popup::closed, flyout, &QObject::deleteLater);
flyout->showAt(anchorButton);import fluentqt
flyout = fluentqt.Flyout(window)
flyout.setPlacement(fluentqt.Flyout.Placement.Right)
populate_flyout(flyout)
flyout.closed.connect(flyout.deleteLater)
flyout.showAt(anchor_button)API
DeclarationNo matching API members.
fluent::dialogs_flyouts::Flyout
Inherits Popup
Popup anchored to a target with placement and window clamping rules.
Constructors
Properties
Placement placementPreferred flyout placement relative to its anchor.
Readplacement()WritesetPlacement()NotifyplacementChanged()int anchorOffsetOffset from the anchor edge in pixels.
ReadanchorOffset()WritesetAnchorOffset()NotifyanchorOffsetChanged()bool clampToWindowWhether flyout geometry is clamped to the host window.
ReadclampToWindow()WritesetClampToWindow()NotifyclampToWindowChanged()
Methods
Placement placement() constPreferred flyout placement relative to its anchor.
void setPlacement(Placement p)Preferred flyout placement relative to its anchor.
int anchorOffset() constOffset from the anchor edge in pixels.
void setAnchorOffset(int px)Offset from the anchor edge in pixels.
bool clampToWindow() constWhether flyout geometry is clamped to the host window.
void setClampToWindow(bool e)Whether flyout geometry is clamped to the host window.
void showAt(QWidget* anchor)Opens the flyout at the anchor; equals setAnchor(anchor) + open().
void setAnchor(QWidget* anchor)Sets the anchor without opening.
Signals
void placementChanged(Placement p)Preferred flyout placement relative to its anchor.
void anchorOffsetChanged(int px)Offset from the anchor edge in pixels.
void clampToWindowChanged(bool enabled)Whether flyout geometry is clamped to the host window.
Enumerations
enum PlacementTopAbove the anchor.BottomBelow the anchor.LeftLeft of the anchor.RightRight of the anchor.FullCentered in the top-level window (base-class default).AutoPrefer Bottom, flipping to Top when space runs out.
Destructors
Subclass interfaces
Methods
QPoint computePosition() const overrideOverride: computes the move() target from the anchor geometry, the placement, and the flyout size (including shadow-margin compensation).
Inherited from fluent::dialogs_flyouts::Popup
Properties
bool isOpenLogical requested open state, not animation-complete or QWidget visibility.
ReadisOpen()WritesetIsOpen()NotifyisOpenChanged()ClosePolicy closePolicyPolicy controlling outside-click, escape, or programmatic close behavior.
ReadclosePolicy()WritesetClosePolicy()NotifyclosePolicyChanged()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. Only applies when dim is enabled.
ReaddimOpacity()WritesetDimOpacity()NotifydimOpacityChanged()double backdropBlurRadiusCached content-backdrop blur radius in logical pixels [0, 32]; 0 disables blur. Defaults to 4 for modal surfaces and 0 otherwise until explicitly set. Explicit values, including 0, persist across modality changes.
ReadbackdropBlurRadius()WritesetBackdropBlurRadius()NotifybackdropBlurRadiusChanged()bool animationEnabledWhether popup open/close transitions are animated.
ReadisAnimationEnabled()WritesetAnimationEnabled()NotifyanimationEnabledChanged()double popupProgressPopup open/close animation progress.
ReadpopupProgress()WritesetPopupProgress()NotifypopupProgressChanged()
Methods
bool isOpen() constLogical requested open state, not animation-complete or QWidget visibility.
ClosePolicy closePolicy() constPolicy controlling outside-click, escape, or programmatic close behavior.
void setClosePolicy(ClosePolicy p)Policy controlling outside-click, escape, or programmatic close behavior.
bool isModal() constWhether the overlay blocks interaction outside itself.
void setModal(bool m)Whether the overlay blocks interaction outside itself.
bool lightDismissConsumesPress() constWhen true, a CloseOnPressOutside light-dismiss SWALLOWS the dismissing press instead of letting it fall through to whatever is underneath — ComboBox-dropdown semantics (one click only closes the popup; it does not also activate the control beneath). Default false keeps the menu-style behaviour where the dismiss click still hits its target.
void addLightDismissPassthrough(QWidget* widget)Regions exempt from the consume above: a dismissing press that lands inside one of these widgets still falls through to it, so a sibling toolbar / nav bar stays one-click reachable while the popup closes. Only meaningful together with lightDismissConsumesPress.
bool isDim() constWhether a dim/scrim layer is shown behind the overlay.
void setDim(bool d)Whether a dim/scrim layer is shown behind the overlay.
double dimOpacity() constScrim opacity in [0, 1]; -1 uses the theme smoke token. Only applies when dim is enabled.
void setDimOpacity(double opacity)Scrim opacity in [0, 1]; -1 uses the theme smoke token. Only applies when dim is enabled.
double backdropBlurRadius() constCached content-backdrop blur radius in logical pixels [0, 32]; 0 disables blur. Defaults to 4 for modal surfaces and 0 otherwise until explicitly set. Explicit values, including 0, persist across modality changes.
void setBackdropBlurRadius(double radius)Cached content-backdrop blur radius in logical pixels [0, 32]; 0 disables blur. Defaults to 4 for modal surfaces and 0 otherwise until explicitly set. Explicit values, including 0, persist across modality changes.
bool isAnimationEnabled() constWhether popup open/close transitions are animated.
void setAnimationEnabled(bool e)Whether popup open/close transitions are animated.
bool isExitAnimationEnabled() constWhen false, close() skips the exit (fade-out) animation and hides instantly; the open/enter animation is unaffected. Lets a caller drop just the dismissal animation for a specific popup without touching the shared default — e.g. when the opacity-effect fade-out misbehaves over a native vibrancy backdrop on macOS.
void setThemeSource(QWidget* source)Uses a widget as the local theme source when no anchor drives the popup.
double popupProgress() constPopup open/close animation progress.
void setPopupProgress(double p)Popup open/close animation progress.
void setPosition(QWidget* relativeTo, const QPoint& localPos)Positions the popup's top-left in the given widget's local coordinates; with relativeTo == topLevelWidget this is window-relative. Coordinates reference the visible card corner; open() compensates the shadow margin. While open, the popup follows relativeTo and closes when it is fully clipped. Without a call, open() centers the popup.
void setIsOpen(bool open)Logical requested open state, not animation-complete or QWidget visibility.
void refreshBackdrop()Refreshes the cached backdrop after application content changes behind an open popup.
void closeWithReason(CloseReason reason)Closes with an explicit reason; close() uses Programmatic unless a reason is pending.
Signals
void isOpenChanged(bool open)Logical requested open state, not animation-complete or QWidget visibility.
void opening()Opening transition started. Compatibility alias: aboutToShow().
void closing(CloseReason reason)Closing transition started. aboutToHide() is the parameterless compatibility alias.
void popupProgressChanged(double progress)Popup open/close animation progress.
void closePolicyChanged(ClosePolicy policy)Policy controlling outside-click, escape, or programmatic close behavior.
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. Only applies when dim is enabled.
void backdropBlurRadiusChanged(double radius)Cached content-backdrop blur radius in logical pixels [0, 32]; 0 disables blur. Defaults to 4 for modal surfaces and 0 otherwise until explicitly set. Explicit values, including 0, persist across modality changes.
void animationEnabledChanged(bool enabled)Whether popup open/close transitions are animated.
Enumerations
enum CloseFlagNoAutoClose = 0CloseOnPressOutside = 1 << 0CloseOnEscape = 1 << 1
enum CloseReasonWhy an overlay closed.
Programmatic = 0ActionButton = 1CloseButton = 2LightDismiss = 3TargetDestroyed = 4Escape = 5
Types and aliases
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