Don't show focus rect for QCommandLinkButton

Since QPushButton sets WA_MacShowFocusRect attribute upon init, this
will be set for QCommandLinkButton too. However, we do not want to draw
the Mac focus frame for QCommandLink buttons so remove this attribute
for them.

Change-Id: Ida7a437a54be078caaebc2c0744243d50e14a87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f8f955151a6a218e1d274663c7c309b8eb6ca92a)
Reviewed-by: Doris Verria <doris.verria@qt.io>
This commit is contained in:
Doris Verria 2020-12-10 02:06:32 +01:00 committed by Tarja Sundqvist
parent 03b3348af9
commit af632e2056

View File

@ -216,6 +216,7 @@ void QCommandLinkButtonPrivate::init()
Q_Q(QCommandLinkButton);
QPushButtonPrivate::init();
q->setAttribute(Qt::WA_Hover);
q->setAttribute(Qt::WA_MacShowFocusRect, false);
QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::PushButton);
policy.setHeightForWidth(true);