diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index c2e5871..aab16cb 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2412,9 +2412,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW break; case PM_ToolBarFrameWidth: ret = 1; - if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent())) - if (mainWindow->unifiedTitleAndToolBarOnMac()) - ret = 0; + if (widget) { + if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent())) + if (mainWindow->unifiedTitleAndToolBarOnMac()) + ret = 0; + } break; default: ret = QWindowsStyle::pixelMetric(metric, opt, widget); |