Fluent-Qt

API reference

FluentElement

Provides shared Fluent design tokens and theme callbacks to QWidget-based components.

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() const

Resolves the theme used by this element, honoring an inherited QWidget override.

bool effectiveThemeUsesDarkAppearance() const

Returns whether this element's effective theme uses dark-backed chrome.

QJsonObject themeOverrides() const

Returns this element's authored overrides.

void clearThemeOverrides()

Restores all token fields to global theme defaults.

const Colors& themeColorsRef() const

Non-copying access to the active color set (for hot paint paths).

Material::AcrylicToken themeAcrylic() const

Material, elevation, and adaptive layout tokens.

QColor themeBackdrop(bool active) const

Window-chrome backdrop color for the given activation state.

virtual void onThemeUpdated()

Called after the global theme changes.

Enumerations

enum Theme

Global visual theme used when resolving design tokens.

  • Light = 0
  • Dark = 1
  • HighContrast = 2

Types and aliases

struct Colors

Design token snapshots returned to components.

Subclass interfaces

Constructors

Fields

FluentElementPrivate* d_ptr

Reserved for 1.x source compatibility.

Destructors

fluent::FluentElement::Colors

Design token snapshots returned to components.

Fields

QColor strokeFocusOuter, strokeFocusInner

Two-layer focus ring strokes.

QColor textOnAccent

Text on accent backgrounds (white/black).

QColor textAccentPrimary

Accent text on plain backgrounds (dark/light blue).

QColor bgLayerOverlay

layered content mask for translucent windows.

fluent::FluentElement::FontStyle

Methods

Fields

QString styleName

Exact static face, e.g. "Regular" or "Semibold".

int lineHeight

Absolute line height in px, measured from Figma.

fluent::FluentElement::Radius

Fields

int none

0: square corners.

int control

4: in-page controls.

int overlay

8: overlay containers (Dialog, ToolTip, Flyout).

fluent::FluentElement::Spacing

Fields

controlHeight

Standard control heights.

fluent::FluentElement::Animation

Fields