From e335a81c191c974a516d3dae5fe8d1b6a28d6068 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 30 Mar 2016 16:21:53 +0200 Subject: [PATCH] Fix isQtQuickControl check with Qt 5.7 Only check for QQuickItem instead of private class names. Also changed remaining places to use the isQtQuickControl function. REVIEW: 127524 --- kstyle/breezestyle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 0341526c..403771c2 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -460,7 +460,7 @@ namespace Breeze if( qobject_cast( widget ) ) return Metrics::Menu_FrameWidth; if( qobject_cast( widget ) ) return Metrics::LineEdit_FrameWidth; #if QT_VERSION >= 0x050000 - else if( option && option->styleObject && option->styleObject->inherits( "QQuickStyleItem" ) ) + else if( isQtQuickControl( option, widget ) ) { const QString &elementType = option->styleObject->property( "elementType" ).toString(); if( elementType == QLatin1String( "edit" ) || elementType == QLatin1String( "spinbox" ) ) @@ -3079,7 +3079,7 @@ namespace Breeze _helper->renderMenuFrame( painter, option->rect, background, outline, hasAlpha ); #if !BREEZE_USE_KDE4 - } else if( option->styleObject && option->styleObject->inherits( "QQuickItem" ) ) { + } else if( isQtQuickControl( option, widget ) ) { const QPalette& palette( option->palette ); const QColor background( _helper->frameBackgroundColor( palette ) ); @@ -6868,7 +6868,7 @@ namespace Breeze bool Style::isQtQuickControl( const QStyleOption* option, const QWidget* widget ) const { #if QT_VERSION >= 0x050000 - return (widget == nullptr) && option && option->styleObject && option->styleObject->inherits( "QQuickStyleItem" ); + return (widget == nullptr) && option && option->styleObject && option->styleObject->inherits( "QQuickItem" ); #else Q_UNUSED( widget ); Q_UNUSED( option );