Fluent-Qt

基于 Qt Widgets 的 FluentQt uilib,附带 Gallery 演示应用。

UI 运行时 Qt Widgets
Qt 支持 Qt 5.15+ / Qt 6.2+
平台 Windows / macOS
语言 C++17
Fluent-Qt Gallery showing real component pages

依赖

C++17、Qt Widgets、CMake presets 和 vcpkg。

使用顺序

先编译 FluentQt uilib,再集成到业务项目;Gallery 用来查看控件效果。

C++17 / Qt 5.15+ / Qt 6.2+
01

UI runtime

Qt Widgets,支持 Qt 5.15+ 或 Qt 6.2+。

02

Build

使用 CMake presets 和 vcpkg manifest mode。

03

Tests

库依赖 spdlog,测试使用 GTest。

uilib 编译 关闭 Gallery 和 tests 后构建 FluentQt target。
uilib 使用 业务项目链接 FluentQt::FluentQt。
Gallery 打包 CPack preset 生成 DMG 和 Windows installer。

FluentQt uilib

业务项目链接 FluentQt::FluentQt 后使用这些控件。

Button component thumbnail

Button

命令入口

ToggleSwitch component thumbnail

ToggleSwitch

二值设置

Slider component thumbnail

Slider

连续数值

ComboBox component thumbnail

ComboBox

选项选择

LineEdit component thumbnail

LineEdit

聚焦文本输入

ColorPicker component thumbnail

ColorPicker

可视化选色

NavigationView component thumbnail

NavigationView

应用外壳导航

TabView component thumbnail

TabView

多面板工具

ListView component thumbnail

ListView

密集行列表

TreeView component thumbnail

TreeView

层级结构

ContentDialog component thumbnail

ContentDialog

聚焦决策

InfoBar component thumbnail

InfoBar

内联状态提示

FluentQt uilib 使用

业务项目链接 FluentQt::FluentQt。

支持已安装 CMake 包,也支持源码子项目。最小消费示例见 examples/hello_world/。

CMake 目标

核心目标是 FluentQt::FluentQt。

应用创建 QApplication,调用 fluent::initializeResources(),然后按命名空间使用控件。

01

安装包方式

find_package(FluentQt CONFIG REQUIRED) 后链接 FluentQt::FluentQt。

02

源码子项目

add_subdirectory 前可以关掉 Gallery、测试、install 和 Gallery 打包。

03

example

examples/hello_world/ 提供最小消费示例。

示例代码

CMake + QWidget

# CMakeLists.txt
find_package(FluentQt CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE FluentQt::FluentQt)

// main.cpp
#include <FluentQt/FluentQt.h>

fluent::initializeResources();

auto* button = new fluent::basicinput::Button("Save", this);

Gallery 可单独构建,用来查看控件效果。

Gallery 打包

CMakePresets.json 提供 Gallery 的打包 preset。

release 构建后使用 CPack 生成 Windows installer 或 macOS DMG。

Windows x64 vcpkg-windows-installer
Windows ARM64 vcpkg-windows-arm64-installer
macOS arm64 vcpkg-osx-dmg
macOS x64 vcpkg-osx-x64-dmg
CPack DMG / Windows installer