QCommandLinkButton: reload icon on style change

Different styles provide different icons for SP_CommandLink so reload
the icon on every style change.

Change-Id: I2d8bd706d4c1bca89b91c90f1bb90a796b38e0d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4c518b210ad56cb51c17e6e1b4a81b0deb7253c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fba5f806e6d7b7ab3a4c5e0796a0149218888843)
This commit is contained in:
Christian Ehrlicher 2024-12-24 14:21:21 +01:00 committed by Qt Cherry-pick Bot
parent f72431d0f9
commit e356f88e54

View File

@ -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);
}