widgets: Add a QT_CONFIG(style_stylesheet) guard

for isWindowsStyle in QDockWidget

Change-Id: Id471b91a415f1a677ced6022bdd05b7e1b72aad2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Mikhail Svetkin 2018-03-16 17:02:21 +01:00
parent 0ffb7c419a
commit 91a52fc6a0

View File

@ -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<const QStyleSheetStyle *>(style)->baseStyle()
: style;
const QStyle *effectiveStyle = style;
#if QT_CONFIG(style_stylesheet)
if (style->inherits("QStyleSheetStyle"))
effectiveStyle = static_cast<const QStyleSheetStyle *>(style)->baseStyle();
#endif
return effectiveStyle->inherits("QWindowsStyle");
}