From d4c518b210ad56cb51c17e6e1b4a81b0deb7253c Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Tue, 24 Dec 2024 14:21:21 +0100 Subject: [PATCH] QCommandLinkButton: reload icon on style change Different styles provide different icons for SP_CommandLink so reload the icon on every style change. Pick-to: 6.9 6.8 Change-Id: I2d8bd706d4c1bca89b91c90f1bb90a796b38e0d3 Reviewed-by: Volker Hilsheimer --- src/widgets/widgets/qcommandlinkbutton.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widgets/widgets/qcommandlinkbutton.cpp b/src/widgets/widgets/qcommandlinkbutton.cpp index 5c7d2601d9e..d8fa2daf7c8 100644 --- a/src/widgets/widgets/qcommandlinkbutton.cpp +++ b/src/widgets/widgets/qcommandlinkbutton.cpp @@ -276,6 +276,12 @@ QCommandLinkButton::~QCommandLinkButton() /*! \reimp */ bool QCommandLinkButton::event(QEvent *e) { + if (e->type() == QEvent::StyleChange) { + QStyleOptionButton opt; + initStyleOption(&opt); + setIcon(style()->standardIcon(QStyle::SP_CommandLink, &opt, this)); + } + return QPushButton::event(e); }