From 91a52fc6a0a8b0fc40285967e5da05ea72e1d75b Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Fri, 16 Mar 2018 17:02:21 +0100 Subject: widgets: Add a QT_CONFIG(style_stylesheet) guard for isWindowsStyle in QDockWidget Change-Id: Id471b91a415f1a677ced6022bdd05b7e1b72aad2 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qdockwidget.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/widgets/widgets/qdockwidget.cpp') diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index e17c2c1f4c..84cb78a474 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -160,9 +160,13 @@ bool QDockWidgetTitleButton::event(QEvent *event) static inline bool isWindowsStyle(const QStyle *style) { // Note: QStyleSheetStyle inherits QWindowsStyle - const QStyle *effectiveStyle = style->inherits("QStyleSheetStyle") - ? static_cast(style)->baseStyle() - : style; + const QStyle *effectiveStyle = style; + +#if QT_CONFIG(style_stylesheet) + if (style->inherits("QStyleSheetStyle")) + effectiveStyle = static_cast(style)->baseStyle(); +#endif + return effectiveStyle->inherits("QWindowsStyle"); } -- cgit v1.2.3