6.0.0-rc4Source

QCommandLinkButton Class

The QCommandLinkButton class provides a large flat button with an arrow, a title and a description. More…

Header#include <QCommandLinkButton>
CMaketarget_link_libraries(app PRIVATE Nt::Widgets)
ModuleNt Widgets C++ Classes
InheritsQPushButton

List of all members, including inherited members

Public Functions

QCommandLinkButton(QWidget *parent = nullptr)
QCommandLinkButton(const QString &text, QWidget *parent = nullptr)
QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr)
~QCommandLinkButton()
QStringdescription() const
voidsetDescription(const QString &description)

Reimplemented Public Functions

Reimplemented Protected Functions

voidpaintEvent(QPaintEvent *event)

Detailed Description

Command link buttons are the choices of a dialog that asks what to do, each with a line that explains it:

auto *save = new QCommandLinkButton("Save", "Keep the changes in the file.", dialog);
connect(save, &QPushButton::clicked, dialog, &QDialog::accept);

The button is flat until the mouse is over it, and draws an arrow before its title, which is larger than the text of other buttons. Lines of the description are wrapped to the width of the button.

See also QPushButton.

Differences from Qt

The arrow is drawn rather than taken from the icon theme, and there is no setIcon().

Member Function Documentation

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

Constructs a command link button with the given parent.

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

Constructs a command link button with the given title text and parent.

QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr)

Constructs a command link button with the given title text, description and parent.

[override] QCommandLinkButton::~QCommandLinkButton()

Destroys the button.

QString QCommandLinkButton::description() const

Returns the description under the title.

See also setDescription().

[override] QSize QCommandLinkButton::minimumSizeHint() const

Reimplements QPushButton::minimumSizeHint().

[override, protected] void QCommandLinkButton::paintEvent(QPaintEvent *event)

Reimplements QPushButton::paintEvent().

void QCommandLinkButton::setDescription(const QString &description)

Sets the description under the title to description.

[override] QSize QCommandLinkButton::sizeHint() const

Reimplements QPushButton::sizeHint().