QCommandLinkButton 小部件提供 Vista 风格的命令链接按钮。 更多...
头: | #include <QCommandLinkButton> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
继承: | QPushButton |
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 |
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.
另请参阅 QPushButton and QRadioButton .
此特性保持描述性标签,以补充按钮文本
设置此特性将在按钮上设置描述性文本,以补充文本标签。这通常会以比首要文本更小的字体显示。
访问函数:
QString | description () const |
void | setDescription (const QString & description ) |
此特性确定按钮是被显示为平板,还是带边框。
默认情况下,此特性被设为 false。
访问函数:
bool | isFlat () const |
void | setFlat (bool) |
另请参阅 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