diff --git a/src/widgets/widgets/qcommandlinkbutton.cpp b/src/widgets/widgets/qcommandlinkbutton.cpp index e9462ed229..4f0de092be 100644 --- a/src/widgets/widgets/qcommandlinkbutton.cpp +++ b/src/widgets/widgets/qcommandlinkbutton.cpp @@ -264,6 +264,12 @@ QSize QCommandLinkButton::minimumSizeHint() const return size; } +void QCommandLinkButton::initStyleOption(QStyleOptionButton *option) const +{ + QPushButton::initStyleOption(option); + option->features |= QStyleOptionButton::CommandLinkButton; +} + /*! Constructs a command link with no text and a \a parent. */ diff --git a/src/widgets/widgets/qcommandlinkbutton.h b/src/widgets/widgets/qcommandlinkbutton.h index c48522ee62..2a1ae05807 100644 --- a/src/widgets/widgets/qcommandlinkbutton.h +++ b/src/widgets/widgets/qcommandlinkbutton.h @@ -69,6 +69,7 @@ public: QSize sizeHint() const override; int heightForWidth(int) const override; QSize minimumSizeHint() const override; + void initStyleOption(QStyleOptionButton *option) const override; protected: bool event(QEvent *e) override;