diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index ab0014d4..da3abaca 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -357,9 +357,12 @@ namespace Breeze } else if( QComboBox *comboBox = qobject_cast( widget ) ) { - QAbstractItemView *itemView( comboBox->view() ); - if( itemView && itemView->itemDelegate() && itemView->itemDelegate()->inherits( "QComboBoxDelegate" ) ) - { itemView->setItemDelegate( new BreezePrivate::ComboBoxItemDelegate( itemView ) ); } + if( !hasParent( widget, "QWebView" ) ) + { + QAbstractItemView *itemView( comboBox->view() ); + if( itemView && itemView->itemDelegate() && itemView->itemDelegate()->inherits( "QComboBoxDelegate" ) ) + { itemView->setItemDelegate( new BreezePrivate::ComboBoxItemDelegate( itemView ) ); } + } } else if( widget->inherits( "QComboBoxPrivateContainer" ) ) { diff --git a/kstyle/breezestyle.h b/kstyle/breezestyle.h index c22a4065..c3ea3fb6 100644 --- a/kstyle/breezestyle.h +++ b/kstyle/breezestyle.h @@ -421,6 +421,12 @@ namespace Breeze //* return which arrow button is hit by point for scrollbar double buttons inline QStyle::SubControl scrollBarHitTest( const QRect&, const QPoint&, const QStyleOption* ) const; + //! return true if one of the widget's parent inherits requested type + inline bool hasParent( const QWidget*, const char* ) const; + + //* return true if one of the widget's parent inherits requested type + template bool hasParent( const QWidget* ) const; + private: //*@name scrollbar button types (for addLine and subLine ) @@ -511,6 +517,33 @@ namespace Breeze } + //_________________________________________________________________________ + bool Style::hasParent( const QWidget* widget, const char* className ) const + { + + if( !widget ) return false; + + while( (widget = widget->parentWidget()) ) + { if( widget->inherits( className ) ) return true; } + + return false; + + } + + //_________________________________________________________________________ + template< typename T > bool Style::hasParent( const QWidget* widget ) const + { + + if( !widget ) return false; + + while( (widget = widget->parentWidget()) ) + { if( qobject_cast( widget ) ) return true; } + + return false; + + } + + } #endif