QCommandLinkButton Class
QCommandLinkButton widget 提供了一个 Vista 风格的命令链接按钮。更多
标题 | #include <QCommandLinkButton> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
继承: | QPushButton |
属性
- description : QString
- flat : bool
公共函数
QCommandLinkButton(QWidget *parent = nullptr) | |
QCommandLinkButton(const QString &text, QWidget *parent = nullptr) | |
QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr) | |
virtual | ~QCommandLinkButton() |
QString | description() const |
void | setDescription(const QString &description) |
重新实现的公共函数
virtual int | heightForWidth(int width) const override |
virtual QSize | minimumSizeHint() const override |
virtual QSize | sizeHint() const override |
重新实现的受保护函数
virtual bool | event(QEvent *e) override |
virtual void | paintEvent(QPaintEvent *) override |
详细说明
命令链接是 Windows Vista 引入的新控件。它的预期用途与单选按钮类似,用于在一组互斥选项中进行选择。命令链接按钮不应单独使用,而应作为向导和对话框中单选按钮的替代品,使按下 "下一步 "按钮成为多余。它的外观一般与平面按钮相似,但除了正常的按钮文本外,还允许使用描述性文本。默认情况下,它还带有一个箭头图标,表示按下该控件将打开另一个窗口或页面。
另请参见 QPushButton 和QRadioButton 。
属性文档
description : QString
该属性包含一个描述性标签,用于补充按钮文本
设置此属性将在按钮上设置一个描述性文本,作为文本标签的补充。描述性文本的字体通常比主文本小。
访问功能:
QString | description() const |
void | setDescription(const QString &description) |
flat : bool
该属性决定按钮是以平面显示还是带边框显示。
默认情况下,该属性设置为 false。
访问功能:
另请参阅 QPushButton::flat 。
成员函数文档
[explicit]
QCommandLinkButton::QCommandLinkButton(QWidget *parent = nullptr)
构建一个不带文本的命令链接,链接地址为parent 。
[explicit]
QCommandLinkButton::QCommandLinkButton(const QString &text, QWidget *parent = nullptr)
用父parent 和文本text 构建命令链接。
[explicit]
QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr)
用text 、description 和parent 构建命令链接。
[virtual noexcept]
QCommandLinkButton::~QCommandLinkButton()
毁灭者
[override virtual protected]
bool QCommandLinkButton::event(QEvent *e)
重实现:QPushButton::event(QEvent *e)。
[override virtual]
int QCommandLinkButton::heightForWidth(int width) const
重实现:QWidget::heightForWidth(int w) const.
[override virtual]
QSize QCommandLinkButton::minimumSizeHint() const
重实现:QPushButton::minimumSizeHint() const.
[override virtual protected]
void QCommandLinkButton::paintEvent(QPaintEvent *)
重实现:QPushButton::paintEvent(QPaintEvent *).
[override virtual]
QSize QCommandLinkButton::sizeHint() const
重实现:QPushButton::sizeHint() const.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.