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.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、CPython 3.13、PySide6 / Qt 6.11.1。 其他平台的桌面表现需另行验证。Windows 11 云母效果在系统不支持时回退普通背景。

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

来源与许可

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

Metadata

Release files for fluentpy-qt 0.8.0

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.0
File Size Uploaded Provenance Actions
fluentpy_qt-0.8.0.tar.gz 3.3 MB Without provenance Details for fluentpy_qt-0.8.0.tar.gz

Built distributions (wheels)

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

Total release size: 9.1 MB

Release files / fluentpy_qt-0.8.0.tar.gz

Download URL fluentpy_qt-0.8.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
96cfc20f0a398abb09cc65314d1ae480c18d9f121cfef810511ddabde76ff5f0
BLAKE2b-256 checksum
How to use checksums
d5f5e3790cc04e32c4099cf03cdae075f23791281a138b0d27ebbef0c8be9191
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.0-py3-none-any.whl

Download URL fluentpy_qt-0.8.0-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f81c94a26555fdac402e4216e17255adb82caaa62a2af5ee1fd97f1f069a12c6
BLAKE2b-256 checksum
How to use checksums
155f2b38cbf3c1d4c4d40b6a05f331260d7b803aa5e4c55d79a1ccaa439a0990
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.0-cp313-cp313-win_amd64.whl

Download URL fluentpy_qt-0.8.0-cp313-cp313-win_amd64.whl
Size 3.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e9b94c939be7422877944840211fb59e39146a6b2d014afc271999971d5462db
BLAKE2b-256 checksum
How to use checksums
62b21c3df60030b40d98915dfa1cdf00297db78512f73187147bc89311c65f07
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.0

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