百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Q

QRibbon

> 编程语言
开源

Qt 实现的 Ribbon 风格菜单栏的基本思路是定制 QTabWidget,通过 QSS(样式表)实现显示样式的调整,QRibbon 的原则是尽量不侵入正常的业务逻辑开发,因此在开发基于 QMainWindow 的程序时,可以按照正常的开发流程创建界面,创建普通的菜单栏以及菜单项及其信号槽关联,最后调用 QRibbon::ins

689 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Qt 实现的 Ribbon 风格菜单栏的基本思路是定制 QTabWidget,通过 QSS(样式表)实现显示样式的调整,QRibbon 的原则是尽量不侵入正常的业务逻辑开发,因此在开发基于 QMainWindow 的程序时,可以按照正常的开发流程创建界面,创建普通的菜单栏以及菜单项及其信号槽关联,最后调用 QRibbon::ins

Language

  • English
  • 中文

English

QRibbon

A Ribbon-style menu bar implemented in Qt, the basic idea is to customize QTabWidget and adjust the display style through QSS (style sheet). The principle of QRibbon is to minimize intrusion into normal business logic development. Therefore, when developing programs based on QMainWindow, you can create interfaces, create normal menu bars and menu items, and associate their signal slots as usual. Finally, call the QRibbon::install(&mainWindow) function to automatically create a Ribbon corresponding to the original QMenuBar of QMainWindow...

Usage

  • Create a QMainWindow as usual.

  • Add menus and menu items to the QMainWindow (It is recommended to add appropriate icons for all menu items, so that QRibbon can directly use the icons of menu items as button icons).

  • Add all files related to the QRibbon library to the project.

  • After constructing the main interface, call the following code to add QRibbon:

    QRibbon::install(&mainWindow);

Comparison of effects before and after using QRibbon::install(window)

Interface before using QRibbon

Interface after using QRibbon


中文

QRibbon

Qt 实现的 Ribbon 风格菜单栏,基本思路是定制QTabWidget,通过QSS(样式表)实现显示样式的调整,QRibbon的原则是尽量不侵入正常业务逻辑的开发,所以在开发基于QMainWindow的程序时,可以按照正常的开发流程创建界面,创建普通的菜单栏以及菜单项及其信号槽关联,最后调用QRibbon::install(&mainWindow)函数即可自动创建出与QMainWindow原有QMenuBar相对应的Ribbon...

使用方法

  • 正常创建QMainWindow

  • 为QMainWindow添加菜单和菜单项(建议为所有菜单项都添加合适的图标,这样最终QRibbon就可以直接使用菜单项的图标作为按钮图标)

  • 将QRibbon库相关的所有文件添加至工程

  • 构造完成主界面后,调用如下代码即可实现QRibbon的添加:

    QRibbon::install(&mainWindow);

使用QRibbon::install(window)前后效果对比

使用QRibbon前界面效果

使用QRibbon后界面效果

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++qtribbonui

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言