Fluent-Qt

Foundations

Icons

Show bundled Fluent icons or glyphs from an application-provided font.

Use icon names

Use the names in Typography::Icons (C++) or fluentqt.Icons (Python) instead of code points such as "\uE713". FontIcon and Button both accept them.

#include <FluentQt/BasicInput.h>
#include <FluentQt/Foundation.h>

auto* icon = new fluent::FontIcon(Typography::Icons::Settings, this);
icon->setIconSize(Typography::IconSize::Standard);
auto* btn = new fluent::basicinput::Button("Settings", this);
btn->setIconGlyph(Typography::Icons::Settings);

Use your own icon font

Register your TTF/OTF with QFontDatabase, check the returned font ID and family list, then call FontIcon.setFontFamily(). Pass the actual Unicode glyph from your font, including supplementary codepoints, rather than a Fluent catalog name. The custom family uses iconSize exactly, without Fluent optical-size substitution. Color, disabled state, and rotation still apply. An empty family restores bundled icons. Fonts and their licenses remain application-owned; QWidget.setFont() does not select the icon font.

#include <FluentQt/Foundation.h>
#include <QFontDatabase>

const int id = QFontDatabase::addApplicationFont(
    QStringLiteral(":/icons/application.ttf"));
const QStringList families = QFontDatabase::applicationFontFamilies(id);
if (id >= 0 && !families.isEmpty()) {
    // Replace this codepoint with one defined by your font.
    auto* icon = new fluent::FontIcon(QStringLiteral("\uE064"), this);
    icon->setFontFamily(families.first());
    icon->setIconSize(20);
    icon->setAccessibleName(QStringLiteral("Application icon"));
}

Sizes and accessible names

Typography::IconSize lists the sizes the icon font is designed for: Standard (16px) for most controls, Compact (12px) for chevrons and small indicators, and Large (20px) or XLarge (24px) for headers. An icon-only button needs setAccessibleName() so screen readers can announce what it does.

API reference