Ribbon 界面适用的 toolButton
更多...
#include <qxribbon/ribbonbutton.h>
Ribbon 界面适用的 toolButton
相对于普通 toolbutton,主要多了两个类型设置, setButtonType 和 setLargeButtonType
- 注解
- 参见
- setIconSize 函数不在起作用
在文件 ribbonbutton.h 第 20 行定义.
◆ LargeButtonType
| 枚举值 |
|---|
| Normal | icon占大按钮的一半区域, 箭头在按钮最下方,文字可以换一行,对应于office的菜单按钮,下箭头在按钮最下方(默认)
|
| Lite | icon占大按钮的60,文字占40,且文字不换行,对应于wps模式的菜单按钮,下箭头在文字旁边
|
在文件 ribbonbutton.h 第 30 行定义.
◆ RibbonButtonType
◆ RibbonButton() [1/3]
| QxRibbon::RibbonButton::RibbonButton |
( |
QWidget * |
parent = Q_NULLPTR | ) |
|
|
explicit |
◆ RibbonButton() [2/3]
| QxRibbon::RibbonButton::RibbonButton |
( |
QAction * |
defaultAction, |
|
|
QWidget * |
parent = Q_NULLPTR |
|
) |
| |
|
explicit |
◆ ~RibbonButton()
| QxRibbon::RibbonButton::~RibbonButton |
( |
| ) |
|
|
virtual |
◆ RibbonButton() [3/3]
◆ actionEvent()
| void QxRibbon::RibbonButton::actionEvent |
( |
QActionEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ buttonType()
◆ changeEvent()
| void QxRibbon::RibbonButton::changeEvent |
( |
QEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ event()
| bool QxRibbon::RibbonButton::event |
( |
QEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ focusOutEvent()
| void QxRibbon::RibbonButton::focusOutEvent |
( |
QFocusEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ hitButton()
| bool QxRibbon::RibbonButton::hitButton |
( |
const QPoint & |
pos | ) |
const |
|
overrideprotectedvirtual |
◆ isToolButtonTextShift()
| bool QxRibbon::RibbonButton::isToolButtonTextShift |
( |
| ) |
|
|
static |
◆ largeButtonType()
◆ leaveEvent()
| void QxRibbon::RibbonButton::leaveEvent |
( |
QEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ minimumSizeHint()
| QSize QxRibbon::RibbonButton::minimumSizeHint |
( |
| ) |
const |
|
overridevirtual |
◆ mouseMoveEvent()
| void QxRibbon::RibbonButton::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ mousePressEvent()
| void QxRibbon::RibbonButton::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ mouseReleaseEvent()
| void QxRibbon::RibbonButton::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ paintEvent()
| void QxRibbon::RibbonButton::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotectedvirtual |
◆ resizeEvent()
| void QxRibbon::RibbonButton::resizeEvent |
( |
QResizeEvent * |
e | ) |
|
|
overrideprotectedvirtual |
◆ setButtonType()
设置按钮样式
- 注解
- 设置按钮样式过程会调用 setToolButtonStyle, 如果要改变 toolButtonStyle, 如设置为 Qt::ToolButtonIconOnly, 需要在此函数之后设置
- 参数
-
在文件 ribbonbutton.cpp 第 768 行定义.
◆ setLargeButtonType()
◆ setToolButtonTextShift()
| void QxRibbon::RibbonButton::setToolButtonTextShift |
( |
bool |
on | ) |
|
|
static |
◆ sizeHint()
| QSize QxRibbon::RibbonButton::sizeHint |
( |
| ) |
const |
|
overridevirtual |
toolbutton 的尺寸确定是先定下字体的尺寸,再定下icon的尺寸,自底向上,保证字体能显示两行
- 注解
- m_sizeHint 的刷新需要注意
- 返回
在文件 ribbonbutton.cpp 第 728 行定义.
该类的文档由以下文件生成: