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 <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-12-24 14:21:21 +01:00
parent 1b84970b90
commit d4c518b210

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