Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Q

QRibbon

> 编程语言
Open source

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

689 stars0 likes0 views
WebsiteGitHub

About

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++qtribbonui

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

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