diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2010-02-02 11:17:19 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2010-02-02 11:18:13 (GMT) |
commit | 7ced77b654eb46af1221a55e315795c1be1753a0 (patch) | |
tree | 50b9cb09e3ea7780e144bb02f42475dcf740f297 /src/gui | |
parent | 5c8be23e6b5fa732f4c799c783a8b22a85992211 (diff) | |
download | Qt-7ced77b654eb46af1221a55e315795c1be1753a0.zip Qt-7ced77b654eb46af1221a55e315795c1be1753a0.tar.gz Qt-7ced77b654eb46af1221a55e315795c1be1753a0.tar.bz2 |
Fixed potential crash in mac style
Diffstat (limited to 'src/gui')
-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); |