Skip to main content

FluentPy for Qt

Fluent 风格的 Qt for Python 桌面组件库,由性邓的小馒头独立开发,采用 MIT 许可证。

项目主页 · 中文文档 · 源码与示例 · 问题反馈

安装

需要 Python 3.10+。建议在新建的虚拟环境内安装:

python -m venv .venv
# Windows
.venv\Scripts\python -m pip install fluentpy-qt
# macOS / Linux
.venv/bin/python -m pip install fluentpy-qt

PyPI 安装名是 fluentpy-qt,代码导入名仍为 fluentpy。 PyPI 上的 fluentpy 是其他作者的独立项目,请勿用 pip install fluentpy 安装本组件库。 两个项目的导入名称冲突,应放在不同的虚拟环境中使用。

PySide6 会作为依赖安装。Qt、PySide6 等依赖遵循各自的许可证。

第一个窗口

import sys
from fluentpy import AccentButton, FluentWindow
from fluentpy.qt import QtWidgets

app = QtWidgets.QApplication(sys.argv)
window = FluentWindow("你好,FluentPy")
window.resize(800, 560)
window.set_title_bar_enabled(True)
button = AccentButton("你好,世界")
window.content_layout.addWidget(button)
window.show()
sys.exit(app.exec())

组件

0.8.1 改进 Linux、macOS 适配:按系统选择字体、窗口边框和用户数据目录,保留 C 扩展自动回退。详见跨平台使用。

0.8.0 新增树形数据列表、多语言代码高亮、图像与头像控件及音视频播放器。控件可独立导入使用,原有公开接口及导入方式保持兼容。

  • 按钮、输入、前后缀输入、分格密码、复选框和各类下拉选择。
  • 表格、滑块、日期时间滚轮、日历、颜色编辑器和取色。
  • 卡片、可展开容器、导航、流畅窗口、启动页面及主题渐变。
  • 高级右键菜单、消息条、吐司、进度提示和对话框。
  • 拖放、快捷键录制、代码编辑器和音符时间轴。
  • 树形数据列表:层级与平铺排序、分组、状态、数值热度与可编辑单元格,支持外部 Qt 模型。
  • 17 种语言模式的代码高亮,支持开发者提供自己的分词器。
  • 图片 / GIF、圆形头像、头像选择与裁剪、实时图像放大镜。
  • 两种音频播放器、视频播放器,以及可复用的音量弹层与播放控制器。
  • 2625 个矢量图标,包含 MIT 许可的 Microsoft Fluent System Icons,随包保留来源与声明。

0.7.2 起,SplitButton / AccentSplitButton 可同时显示动作文字和自定义说明:

from fluentpy import AccentSplitButton, ActionMenu

launch = AccentSplitButton("启动游戏", window, description="1.0 · 正式版")
versions = ActionMenu(window)
versions.add_action("1.1 · 预览版", callback=lambda: launch.set_description("1.1 · 预览版"))
launch.set_menu(versions)
launch.clicked.connect(lambda: print("启动:", launch.description()))

主区域执行操作,箭头独立展开菜单;选择选项仅更新说明。两行内容自动增高,支持主题、鼠标和键盘反馈;不传 description 时保持原有单行用法。

工作台和独立示例在源码仓库的 examples/ 中,可从源码运行 python examples/showcase.py。 wheel 安装的是组件库,不包含示例工作台。

可选 C 加速

Qt 负责界面和动画;C 扩展加速文本、日期、时间、日历、拖放、快捷键、颜色、输入策略和多语言着色扫描。 默认优先使用 C,扩展缺失或不兼容时自动回退 Python,基本运行无需 C 编译器。

当前提供 Windows x64 / CPython 3.13 的原生 wheel,以及不含本机二进制的通用 Python wheel。 其他 Python 版本和平台使用通用 wheel,运行兼容后端;也可从源码编译对应扩展。 FLUENTPY_BACKEND=python 可强制回退,native 要求对应 C 接口可用。

自动检查涵盖 Windows x64、Linux x64、Intel Mac 与 Apple Silicon Mac。具体版本和结果见 GitHub Actions。Windows 11 云母效果在系统不支持时回退实色背景。

项目处于早期开发阶段。组件接口、用法及 C 构建说明见官方文档。

来源与许可

FluentPy 独立实现组件,仅参考公开的 Fluent 设计与交互思路,不包含参考组件库的源码、样式或示例素材。 Microsoft Fluent UI System Icons 的 MIT 许可与来源声明随包提供。 详情见第三方声明。

Metadata

Release files for fluentpy-qt 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fluentpy-qt 0.8.1
File Size Uploaded Provenance Actions
fluentpy_qt-0.8.1.tar.gz 4.0 MB Without provenance Details for fluentpy_qt-0.8.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fluentpy-qt 0.8.1
File Interpreter ABI Platform Actions
fluentpy_qt-0.8.1-py3-none-any.whl Python 3 none any Details for fluentpy_qt-0.8.1-py3-none-any.whl
fluentpy_qt-0.8.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for fluentpy_qt-0.8.1-cp313-cp313-win_amd64.whl

Total release size: 9.9 MB

Release files / fluentpy_qt-0.8.1.tar.gz

Download URL fluentpy_qt-0.8.1.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a8a82ed35fd626dfd990475dd14ef8f90dba457eeda33bc5b5966ba11221b7f5
BLAKE2b-256 checksum
How to use checksums
dad5434c79bfed9cf5ade055868d79b0b5b0c977e86087cb6801a482557609b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / fluentpy_qt-0.8.1-py3-none-any.whl

Download URL fluentpy_qt-0.8.1-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9e2ca72a6d2129c745a5d00620b886922298c7aab16869a1ab03559a94c313b8
BLAKE2b-256 checksum
How to use checksums
76e9d350497e4e1c1f58c813677d65c87fef668f08c945182760b0d51f145092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / fluentpy_qt-0.8.1-cp313-cp313-win_amd64.whl

Download URL fluentpy_qt-0.8.1-cp313-cp313-win_amd64.whl
Size 3.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
71d6774bc94cd26e78b2a76aaa00220c30156388dc7170829a8fddb6e3089ecc
BLAKE2b-256 checksum
How to use checksums
89de92949cf74fdd512ac324049e25e910c694d22cb10267df5fe4412c9aeec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for fluentpy-qt 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page