Status & info
InfoBadge
A small badge that shows counts, icons, or attention dots.
Example

Usage
Display modes
Auto resolves to a dot, icon, or value based on the badge content.
#include <FluentQt/StatusInfo.h>
using namespace fluent::status_info;
auto* dotBadge = new InfoBadge(this);
auto* iconBadge = new InfoBadge(this);
iconBadge->setIconGlyph(Typography::Icons::Mail);
auto* valueBadge = new InfoBadge(this);
valueBadge->setValue(7);
auto* explicitDot = new InfoBadge(this);
explicitDot->setDisplayMode(InfoBadge::InfoBadgeDisplayMode::Dot);import fluentqt
dot_badge = fluentqt.InfoBadge(row)
icon_badge = fluentqt.InfoBadge(row)
icon_badge.setIconGlyph(fluentqt.Typography.Icons.Mail)
value_badge = fluentqt.InfoBadge(row)
value_badge.setValue(7)
explicit_dot = fluentqt.InfoBadge(row)
explicit_dot.setDisplayMode(fluentqt.InfoBadge.InfoBadgeDisplayMode.Dot)API
DeclarationNo matching API members.
fluent::status_info::InfoBadge
Inherits QWidget · FluentElement · QMLPlus
Compact Fluent badge for value, icon, status, or attention signals.
Constructors
Properties
int valueNumeric badge value shown when display mode resolves to Value.
Readvalue()WritesetValue()NotifyvalueChanged()QString iconGlyphIcon glyph shown when display mode resolves to Icon.
ReadiconGlyph()WritesetIconGlyph()NotifyiconGlyphChanged()InfoBadgeDisplayMode displayModeContent mode used to choose dot, icon, value, or automatic badge rendering.
ReaddisplayMode()WritesetDisplayMode()NotifydisplayModeChanged()InfoBadgeStatus statusSemantic status used to choose visual treatment.
Readstatus()WritesetStatus()NotifystatusChanged()qreal badgeOpacityOpacity applied to the badge visual.
ReadbadgeOpacity()WritesetBadgeOpacity()NotifybadgeOpacityChanged()QColor customBackgroundColorCustom badge background color override.
ReadcustomBackgroundColor()WritesetCustomBackgroundColor()NotifycustomBackgroundColorChanged()QColor customTextColorCustom badge text color override.
ReadcustomTextColor()WritesetCustomTextColor()NotifycustomTextColorChanged()Typography::FontRole valueFontRoleTypography role used by badge value text.
ReadvalueFontRole()WritesetValueFontRole()NotifyvalueFontRoleChanged()int beaconDiameterDiameter of beacon-style badge visuals.
ReadbeaconDiameter()WritesetBeaconDiameter()NotifybeaconDiameterChanged()int badgeHeightHeight of pill-style badge visuals.
ReadbadgeHeight()WritesetBadgeHeight()NotifybadgeHeightChanged()int valueHorizontalPaddingHorizontal padding around badge value text.
ReadvalueHorizontalPadding()WritesetValueHorizontalPadding()NotifyvalueHorizontalPaddingChanged()int iconGlyphSizeIcon glyph size in pixels.
ReadiconGlyphSize()WritesetIconGlyphSize()NotifyiconGlyphSizeChanged()QString iconFontFamilyIconfont family used for glyph rendering.
ReadiconFontFamily()WritesetIconFontFamily()NotifyiconFontFamilyChanged()int badgeBackgroundInsetInset applied to badge background painting.
ReadbadgeBackgroundInset()WritesetBadgeBackgroundInset()NotifybadgeBackgroundInsetChanged()QPoint contentOffsetPixel offset applied to badge content drawing.
ReadcontentOffset()WritesetContentOffset()NotifycontentOffsetChanged()
Methods
int value() constNumeric badge value shown when display mode resolves to Value.
void setValue(int value)Numeric badge value shown when display mode resolves to Value.
QString iconGlyph() constIcon glyph shown when display mode resolves to Icon.
void setIconGlyph(const QString& glyph)Icon glyph shown when display mode resolves to Icon.
InfoBadgeDisplayMode displayMode() constContent mode used to choose dot, icon, value, or automatic badge rendering.
void setDisplayMode(InfoBadgeDisplayMode mode)Content mode used to choose dot, icon, value, or automatic badge rendering.
InfoBadgeStatus status() constSemantic status used to choose visual treatment.
void setStatus(InfoBadgeStatus status)Semantic status used to choose visual treatment.
qreal badgeOpacity() constOpacity applied to the badge visual.
void setBadgeOpacity(qreal opacity)Opacity applied to the badge visual.
QColor customBackgroundColor() constCustom badge background color override.
void setCustomBackgroundColor(const QColor& color)Custom badge background color override.
QColor customTextColor() constCustom badge text color override.
void setCustomTextColor(const QColor& color)Custom badge text color override.
Typography::FontRole valueFontRole() constTypography role used by badge value text.
void setValueFontRole(Typography::FontRole role)Typography role used by badge value text.
int beaconDiameter() constDiameter of beacon-style badge visuals.
void setBeaconDiameter(int diameter)Diameter of beacon-style badge visuals.
int badgeHeight() constHeight of pill-style badge visuals.
void setBadgeHeight(int height)Height of pill-style badge visuals.
int valueHorizontalPadding() constHorizontal padding around badge value text.
void setValueHorizontalPadding(int padding)Horizontal padding around badge value text.
int iconGlyphSize() constIcon glyph size in pixels.
void setIconGlyphSize(int size)Icon glyph size in pixels.
QString iconFontFamily() constIconfont family used for glyph rendering.
void setIconFontFamily(const QString& family)Iconfont family used for glyph rendering.
int badgeBackgroundInset() constInset applied to badge background painting.
void setBadgeBackgroundInset(int inset)Inset applied to badge background painting.
QPoint contentOffset() constPixel offset applied to badge content drawing.
void setContentOffset(const QPoint& offset)Pixel offset applied to badge content drawing.
Signals
void valueChanged(int value)Numeric badge value shown when display mode resolves to Value.
void iconGlyphChanged(const QString& glyph)Icon glyph shown when display mode resolves to Icon.
void displayModeChanged(InfoBadgeDisplayMode mode)Content mode used to choose dot, icon, value, or automatic badge rendering.
void statusChanged(InfoBadgeStatus status)Semantic status used to choose visual treatment.
void badgeOpacityChanged(qreal opacity)Opacity applied to the badge visual.
void customBackgroundColorChanged(const QColor& color)Custom badge background color override.
void customTextColorChanged(const QColor& color)Custom badge text color override.
void valueFontRoleChanged(Typography::FontRole role)Typography role used by badge value text.
void beaconDiameterChanged(int diameter)Diameter of beacon-style badge visuals.
void badgeHeightChanged(int height)Height of pill-style badge visuals.
void valueHorizontalPaddingChanged(int padding)Horizontal padding around badge value text.
void iconGlyphSizeChanged(int size)Icon glyph size in pixels.
void iconFontFamilyChanged(const QString& family)Iconfont family used for glyph rendering.
void badgeBackgroundInsetChanged(int inset)Inset applied to badge background painting.
void contentOffsetChanged(const QPoint& offset)Pixel offset applied to badge content drawing.
Enumerations
enum class InfoBadgeDisplayModeAutoDotIconValue
enum class InfoBadgeStatusInformationalAttentionCautionSuccessCritical
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