- Qt 6.10
- Qt Widgets
- C++ Classes
- QCommandLinkButton
- Qt 6.10.3 Reference Documentation

# QCommandLinkButton Class

The QCommandLinkButton widget provides a Vista style command link button. More...

Header: | `#include <QCommandLinkButton>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Widgets)` `target_link_libraries(mytarget PRIVATE Qt6::Widgets)`
qmake: | `QT += widgets`
Inherits: | QPushButton

- List of all members, including inherited members

## Properties

- description : QString
- flat : bool

## Public Functions

| 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)

## Reimplemented Public Functions

virtual int | heightForWidth(int width) const override
virtual QSize | minimumSizeHint() const override
virtual QSize | sizeHint() const override

## Reimplemented Protected Functions

virtual bool | event(QEvent *e) override
virtual void | paintEvent(QPaintEvent *) override

## Detailed Description

The command link is a new control that was introduced by Windows Vista. Its intended use is similar to that of a radio button in that it is used to choose between a set of mutually exclusive options. Command link buttons should not be used by themselves but rather as an alternative to radio buttons in Wizards and dialogs and makes pressing the "next" button redundant. The appearance is generally similar to that of a flat pushbutton, but it allows for a descriptive text in addition to the normal button text. By default it will also carry an arrow icon, indicating that pressing the control will open another window or page.

See also QPushButton and QRadioButton.

## Property Documentation

### description : QString

This property holds a descriptive label to complement the button text

Setting this property will set a descriptive text on the button, complementing the text label. This will usually be displayed in a smaller font than the primary text.

Access functions:

QString | description() const
void | setDescription(const QString &description)

### flat : bool

This property determines whether the button is displayed as a flat panel or with a border.

By default, this property is set to false.

Access functions:

bool | isFlat() const
void | setFlat(bool)

See also QPushButton::flat.

## Member Function Documentation

### `[explicit]` QCommandLinkButton::QCommandLinkButton(QWidget *parent = nullptr)

Constructs a command link with no text and a parent.

### `[explicit]` QCommandLinkButton::QCommandLinkButton(const QString &text, QWidget *parent = nullptr)

Constructs a command link with the parent parent and the text text.

### `[explicit]` QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr)

Constructs a command link with a text, a description, and a parent.

### `[virtual noexcept]` QCommandLinkButton::~QCommandLinkButton()

Destructor.

### `[override virtual protected]` bool QCommandLinkButton::event(QEvent *e)

Reimplements: QPushButton::event(QEvent *e).

### `[override virtual]` int QCommandLinkButton::heightForWidth(int width) const

Reimplements: QWidget::heightForWidth(int w) const.

### `[override virtual]` QSize QCommandLinkButton::minimumSizeHint() const

Reimplements: QPushButton::minimumSizeHint() const.

### `[override virtual protected]` void QCommandLinkButton::paintEvent(QPaintEvent *)

Reimplements: QPushButton::paintEvent(QPaintEvent *).

### `[override virtual]` QSize QCommandLinkButton::sizeHint() const

Reimplements: QPushButton::sizeHint() const.