diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -4736,14 +4736,18 @@ const bool showIcon( showIconsInMenuItems() ); if( showIcon ) iconWidth = isQtQuickControl( option, widget ) ? qMax( pixelMetric(PM_SmallIconSize, option, widget ), menuItemOption->maxIconWidth ) : menuItemOption->maxIconWidth; - QRect iconRect( contentsRect.left(), contentsRect.top() + (contentsRect.height()-iconWidth)/2, iconWidth, iconWidth ); - contentsRect.setLeft( iconRect.right() + Metrics::MenuItem_ItemSpacing + 1 ); + QRect iconRect; + if( showIcon && iconWidth > 0 ) + { + iconRect = QRect( contentsRect.left(), contentsRect.top() + (contentsRect.height()-iconWidth)/2, iconWidth, iconWidth ); + contentsRect.setLeft( iconRect.right() + Metrics::MenuItem_ItemSpacing + 1 ); + const QSize iconSize( pixelMetric( PM_SmallIconSize, option, widget ), pixelMetric( PM_SmallIconSize, option, widget ) ); + iconRect = centerRect( iconRect, iconSize ); + } if( showIcon && !menuItemOption->icon.isNull() ) { - const QSize iconSize( pixelMetric( PM_SmallIconSize, option, widget ), pixelMetric( PM_SmallIconSize, option, widget ) ); - iconRect = centerRect( iconRect, iconSize ); iconRect = visualRect( option, iconRect ); // icon mode