forked from qt-creator/qt-creator
ManhattanStyle: Fix crash with stylesheets
Most prominently QmlDesigner crashed.
Some widgets have stylesheets set, and QStyleSheetStyle sometimes asks
for pixelMetric with nullptr as styleoption.
Amends c6dc54b343
Change-Id: If1264b29af83f2a489785e3c4f3e8342716ea125
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -214,7 +214,7 @@ int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
||||
switch (metric) {
|
||||
#ifdef Q_OS_MACOS
|
||||
case PM_MenuButtonIndicator:
|
||||
if (widget && option->type == QStyleOption::SO_ToolButton)
|
||||
if (widget && option && option->type == QStyleOption::SO_ToolButton)
|
||||
return 12;
|
||||
break;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user