QCommandLinkButton Class
The QCommandLinkButton class provides a large flat button with an arrow, a title and a description. More…
| Header | #include <QCommandLinkButton> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Widgets) |
| Module | Nt Widgets C++ Classes |
| Inherits | QPushButton |
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() | |
| QString | description() const |
| void | setDescription(const QString &description) |
Reimplemented Public Functions
| QSize | sizeHint() const |
| QSize | minimumSizeHint() const |
Reimplemented Protected Functions
| void | paintEvent(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
QCommandLinkButton::QCommandLinkButton(QWidget *parent = nullptr)
Constructs a command link button with the given parent.
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.
QCommandLinkButton::~QCommandLinkButton()
Destroys the button.
QString QCommandLinkButton::description() const
Returns the description under the title.
See also setDescription().
QSize QCommandLinkButton::minimumSizeHint() const
Reimplements QPushButton::minimumSizeHint().
void QCommandLinkButton::paintEvent(QPaintEvent *event)
Reimplements QPushButton::paintEvent().
void QCommandLinkButton::setDescription(const QString &description)
Sets the description under the title to description.
QSize QCommandLinkButton::sizeHint() const
Reimplements QPushButton::sizeHint().