Fluent-Qt

Status & info

InfoBar

An inline bar for status messages with severity and optional actions.

Example

InfoBar: Severity

Usage

Severity

Severity changes the leading icon and background treatment for status messages.

#include <FluentQt/StatusInfo.h>
using namespace fluent::status_info;

auto* info = new InfoBar(this);
info->setSeverity(InfoBar::Informational);
info->setTitle("Update available");
info->setMessage("Version 3.2 is ready.");

auto* error = new InfoBar(this);
error->setSeverity(InfoBar::Error);
error->setTitle("Upload failed");
error->setMessage("The document could not be saved.");

keepInfoBarOpenWithToast(info);
keepInfoBarOpenWithToast(error);

fluent::status_info::InfoBar

Inherits QWidget · FluentElement · QMLPlus

Fluent inline notification bar with severity, actions, and close behavior.

Constructors

Properties

bool isOpen

Whether the popup, drawer, or notification surface is open.

Read isOpen()Write setIsOpen()Notify isOpenChanged()
QString title

Title text displayed by the surface.

Read title()Write setTitle()Notify titleChanged()
QString message

Message body text displayed by the notification surface.

Read message()Write setMessage()Notify messageChanged()
InfoBarSeverity severity

Severity level used by notification colors and icon.

Read severity()Write setSeverity()Notify severityChanged()
bool isClosable

Whether the close affordance is visible and active.

Read isClosable()Write setIsClosable()Notify isClosableChanged()
bool isIconVisible

Whether the severity icon is visible.

Read isIconVisible()Write setIsIconVisible()Notify isIconVisibleChanged()
bool singleLine

Whether the notification uses compact single-line layout.

Read singleLine()Write setSingleLine()Notify singleLineChanged()
int preferredWidth

Preferred width used by the notification layout.

Read preferredWidth()Write setPreferredWidth()Notify preferredWidthChanged()
int singleLineHeight

Height used by single-line notification layout.

Read singleLineHeight()Write setSingleLineHeight()Notify singleLineHeightChanged()
int multiLineMinHeight

Minimum height used by multi-line notification layout.

Read multiLineMinHeight()Write setMultiLineMinHeight()Notify multiLineMinHeightChanged()
int multiLineActionMinHeight

Minimum height when multi-line layout includes actions.

Read multiLineActionMinHeight()Write setMultiLineActionMinHeight()Notify multiLineActionMinHeightChanged()
QWidget* actionWidget

Optional action widget hosted by the notification.

Read actionWidget()Write setActionWidget()Notify actionWidgetChanged()
QMargins contentMargins

Margins applied around the control content area.

Read contentMargins()Write setContentMargins()Notify contentMarginsChanged()
int closeButtonSize

Size of the close button.

Read closeButtonSize()Write setCloseButtonSize()Notify closeButtonSizeChanged()
QString closeButtonAccessibleName

Accessible name supplied by the application for the icon-only close button.

Read closeButtonAccessibleName()Write setCloseButtonAccessibleName()Notify closeButtonAccessibleNameChanged()
int iconTextSpacing

Spacing between icon and text content.

Read iconTextSpacing()Write setIconTextSpacing()Notify iconTextSpacingChanged()
int titleMessageSpacing

Spacing between title and message text.

Read titleMessageSpacing()Write setTitleMessageSpacing()Notify titleMessageSpacingChanged()
int cornerRadius

Corner radius used by the component background.

Read cornerRadius()Write setCornerRadius()Notify cornerRadiusChanged()
int severityIconSize

Background size reserved for the severity icon.

Read severityIconSize()Write setSeverityIconSize()Notify severityIconSizeChanged()
int severityIconGlyphSize

Glyph size used by the severity icon.

Read severityIconGlyphSize()Write setSeverityIconGlyphSize()Notify severityIconGlyphSizeChanged()
int severityIconBackgroundInset

Inset applied to severity icon background painting.

Read severityIconBackgroundInset()Write setSeverityIconBackgroundInset()Notify severityIconBackgroundInsetChanged()
Typography::FontRole titleFontRole

Typography role used by title text.

Read titleFontRole()Write setTitleFontRole()Notify titleFontRoleChanged()
Typography::FontRole messageFontRole

Typography role used by message text.

Read messageFontRole()Write setMessageFontRole()Notify messageFontRoleChanged()
QString informationalIconGlyph

Icon glyph used for informational severity.

Read informationalIconGlyph()Write setInformationalIconGlyph()Notify informationalIconGlyphChanged()
QString successIconGlyph

Icon glyph used for success severity.

Read successIconGlyph()Write setSuccessIconGlyph()Notify successIconGlyphChanged()
QString warningIconGlyph

Icon glyph used for warning severity.

Read warningIconGlyph()Write setWarningIconGlyph()Notify warningIconGlyphChanged()
QString errorIconGlyph

Icon glyph used for error severity.

Read errorIconGlyph()Write setErrorIconGlyph()Notify errorIconGlyphChanged()

Methods

bool isOpen() const

Whether the popup, drawer, or notification surface is open.

void setIsOpen(bool open)

Whether the popup, drawer, or notification surface is open.

QString title() const

Title text displayed by the surface.

void setTitle(const QString& title)

Title text displayed by the surface.

QString message() const

Message body text displayed by the notification surface.

void setMessage(const QString& message)

Message body text displayed by the notification surface.

InfoBarSeverity severity() const

Severity level used by notification colors and icon.

void setSeverity(InfoBarSeverity severity)

Severity level used by notification colors and icon.

bool isClosable() const

Whether the close affordance is visible and active.

void setIsClosable(bool closable)

Whether the close affordance is visible and active.

bool isIconVisible() const

Whether the severity icon is visible.

void setIsIconVisible(bool visible)

Whether the severity icon is visible.

bool singleLine() const

Whether the notification uses compact single-line layout.

void setSingleLine(bool singleLine)

Whether the notification uses compact single-line layout.

int preferredWidth() const

Preferred width used by the notification layout.

void setPreferredWidth(int width)

Preferred width used by the notification layout.

int singleLineHeight() const

Height used by single-line notification layout.

void setSingleLineHeight(int height)

Height used by single-line notification layout.

int multiLineMinHeight() const

Minimum height used by multi-line notification layout.

void setMultiLineMinHeight(int height)

Minimum height used by multi-line notification layout.

int multiLineActionMinHeight() const

Minimum height when multi-line layout includes actions.

void setMultiLineActionMinHeight(int height)

Minimum height when multi-line layout includes actions.

QWidget* actionWidget() const

Optional action widget hosted by the notification.

void setActionWidget(QWidget* widget)

Optional action widget hosted by the notification.

QMargins contentMargins() const

Margins applied around the control content area.

void setContentMargins(const QMargins& margins)

Margins applied around the control content area.

int closeButtonSize() const

Size of the close button.

void setCloseButtonSize(int size)

Size of the close button.

QString closeButtonAccessibleName() const

Accessible name supplied by the application for the icon-only close button.

void setCloseButtonAccessibleName(const QString& name)

Accessible name supplied by the application for the icon-only close button.

int iconTextSpacing() const

Spacing between icon and text content.

void setIconTextSpacing(int spacing)

Spacing between icon and text content.

int titleMessageSpacing() const

Spacing between title and message text.

void setTitleMessageSpacing(int spacing)

Spacing between title and message text.

int cornerRadius() const

Corner radius used by the component background.

void setCornerRadius(int radius)

Corner radius used by the component background.

int severityIconSize() const

Background size reserved for the severity icon.

void setSeverityIconSize(int size)

Background size reserved for the severity icon.

int severityIconGlyphSize() const

Glyph size used by the severity icon.

void setSeverityIconGlyphSize(int size)

Glyph size used by the severity icon.

int severityIconBackgroundInset() const

Inset applied to severity icon background painting.

void setSeverityIconBackgroundInset(int inset)

Inset applied to severity icon background painting.

Typography::FontRole titleFontRole() const

Typography role used by title text.

void setTitleFontRole(Typography::FontRole role)

Typography role used by title text.

Typography::FontRole messageFontRole() const

Typography role used by message text.

void setMessageFontRole(Typography::FontRole role)

Typography role used by message text.

QString informationalIconGlyph() const

Icon glyph used for informational severity.

void setInformationalIconGlyph(const QString& glyph)

Icon glyph used for informational severity.

QString successIconGlyph() const

Icon glyph used for success severity.

void setSuccessIconGlyph(const QString& glyph)

Icon glyph used for success severity.

QString warningIconGlyph() const

Icon glyph used for warning severity.

void setWarningIconGlyph(const QString& glyph)

Icon glyph used for warning severity.

QString errorIconGlyph() const

Icon glyph used for error severity.

void setErrorIconGlyph(const QString& glyph)

Icon glyph used for error severity.

Signals

void isOpenChanged(bool open)

Whether the popup, drawer, or notification surface is open.

void titleChanged(const QString& title)

Title text displayed by the surface.

void messageChanged(const QString& message)

Message body text displayed by the notification surface.

void severityChanged(InfoBarSeverity severity)

Severity level used by notification colors and icon.

void isClosableChanged(bool closable)

Whether the close affordance is visible and active.

void isIconVisibleChanged(bool visible)

Whether the severity icon is visible.

void singleLineChanged(bool singleLine)

Whether the notification uses compact single-line layout.

void preferredWidthChanged(int width)

Preferred width used by the notification layout.

void singleLineHeightChanged(int height)

Height used by single-line notification layout.

void multiLineMinHeightChanged(int height)

Minimum height used by multi-line notification layout.

void multiLineActionMinHeightChanged(int height)

Minimum height when multi-line layout includes actions.

void actionWidgetChanged(QWidget* widget)

Optional action widget hosted by the notification.

void contentMarginsChanged(const QMargins& margins)

Margins applied around the control content area.

void closeButtonSizeChanged(int size)

Size of the close button.

void closeButtonAccessibleNameChanged(const QString& name)

Accessible name supplied by the application for the icon-only close button.

void iconTextSpacingChanged(int spacing)

Spacing between icon and text content.

void titleMessageSpacingChanged(int spacing)

Spacing between title and message text.

void cornerRadiusChanged(int radius)

Corner radius used by the component background.

void severityIconSizeChanged(int size)

Background size reserved for the severity icon.

void severityIconGlyphSizeChanged(int size)

Glyph size used by the severity icon.

void severityIconBackgroundInsetChanged(int inset)

Inset applied to severity icon background painting.

void titleFontRoleChanged(Typography::FontRole role)

Typography role used by title text.

void messageFontRoleChanged(Typography::FontRole role)

Typography role used by message text.

void informationalIconGlyphChanged(const QString& glyph)

Icon glyph used for informational severity.

void successIconGlyphChanged(const QString& glyph)

Icon glyph used for success severity.

void warningIconGlyphChanged(const QString& glyph)

Icon glyph used for warning severity.

void errorIconGlyphChanged(const QString& glyph)

Icon glyph used for error severity.

Enumerations

enum InfoBarSeverity
  • Informational
  • Success
  • Warning
  • Error

Destructors

PySide6 additions

takeActionWidget()

Release and return the current action as Python-owned content.

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

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 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