diff options
author | Andy Shaw <andy.shaw@qt.io> | 2020-08-07 15:58:24 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-08-17 08:11:18 +0200 |
commit | 135b16900ec2a7388593059735f7950ddd1b34f6 (patch) | |
tree | 0099e6cace5a061df9a40380639d1b0f3db8bfbc /src/widgets/widgets/qmdisubwindow.cpp | |
parent | 77a985a876a60a1f68ae10b67cdb4dfe8621dbf2 (diff) |
macOS: Check if the base of the style as well if it is a QProxyStyle
Since a QProxyStyle could be easily used for just a style hint or
similar we should account for the baseStyle() too to see if it is
effectively a QMacStyle too.
Pick-to: 5.15
Change-Id: I5d1df31f594cac2a7f5f5d1384cb7c278633b29d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmdisubwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 82f72065e0..1b61868868 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -170,6 +170,7 @@ #if QT_CONFIG(menu) #include <QMenu> #endif +#include <QProxyStyle> QT_BEGIN_NAMESPACE @@ -203,7 +204,9 @@ static const int BoundaryMargin = 5; static inline bool isMacStyle(QStyle *style) { - return style->inherits("QMacStyle"); + auto proxyStyle = qobject_cast<QProxyStyle *>(style); + auto styleToCheck = proxyStyle ? proxyStyle->baseStyle() : style; + return styleToCheck->inherits("QMacStyle"); } static inline int getMoveDeltaComponent(uint cflags, uint moveFlag, uint resizeFlag, |