Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcommandlinkbutton.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCOMMANDLINKBUTTON_H
5#define QCOMMANDLINKBUTTON_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qpushbutton.h>
9
11
12QT_BEGIN_NAMESPACE
13
14
15class QCommandLinkButtonPrivate;
16
17class Q_WIDGETS_EXPORT QCommandLinkButton: public QPushButton
18{
19 Q_OBJECT
20
21 Q_PROPERTY(QString description READ description WRITE setDescription)
22 Q_PROPERTY(bool flat READ isFlat WRITE setFlat DESIGNABLE false)
23
24public:
25 explicit QCommandLinkButton(QWidget *parent = nullptr);
26 explicit QCommandLinkButton(const QString &text, QWidget *parent = nullptr);
27 explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr);
28 ~QCommandLinkButton();
29
30 QString description() const;
31 void setDescription(const QString &description);
32
33 QSize sizeHint() const override;
34 int heightForWidth(int) const override;
35 QSize minimumSizeHint() const override;
36 void initStyleOption(QStyleOptionButton *option) const override;
37
38protected:
39 bool event(QEvent *e) override;
40 void paintEvent(QPaintEvent *) override;
41
42private:
43 Q_DISABLE_COPY(QCommandLinkButton)
44 Q_DECLARE_PRIVATE(QCommandLinkButton)
45};
46
47QT_END_NAMESPACE
48
49#endif // QCOMMANDLINKBUTTON
int descriptionHeight(int width) const
QColor mergedColors(const QColor &a, const QColor &b, int value) const
The QCommandLinkButton widget provides a Vista style command link button.
\variable QStyleOptionHeaderV2::textElideMode
\reentrant
Definition qtextlayout.h:70
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(commandlinkbutton)