diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 73bd466d775..9a80347d7ee 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -123,6 +123,9 @@ #if QT_CONFIG(toolbar) #include #endif +#if QT_CONFIG(pushbutton) +#include +#endif #include #include @@ -2943,6 +2946,12 @@ void QStyleSheetStyle::polish(QWidget *w) if (!rule.hasBackground() || rule.background()->isTransparent() || rule.hasBox() || (!rule.hasNativeBorder() && !rule.border()->isOpaque())) w->setAttribute(Qt::WA_OpaquePaintEvent, false); + if (rule.hasBox() || !rule.hasNativeBorder() +#if QT_CONFIG(pushbutton) + || (qobject_cast(w)) +#endif + ) + w->setAttribute(Qt::WA_MacShowFocusRect, false); } }