diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-08-10 11:09:46 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-08-10 11:12:30 (GMT) |
commit | bfc32c590d797599ddfb814f023e5837c663ec23 (patch) | |
tree | 507975af7d86d0a1d03254fef086a99bfe985c04 /src/gui | |
parent | 5f225d68ad6f85fd026bd28d1cdf6010b9555b07 (diff) | |
download | Qt-bfc32c590d797599ddfb814f023e5837c663ec23.zip Qt-bfc32c590d797599ddfb814f023e5837c663ec23.tar.gz Qt-bfc32c590d797599ddfb814f023e5837c663ec23.tar.bz2 |
Mac: Fix crash when using style to draw on other things than widgets
When drawing a complex control using the style, you are allowd to
skip giving a widget as the last argument. But when doing so, it
caused a crash in the mac style.
Reviewed-by: Fabien Freling
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index ae90d26..671a888 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -1440,6 +1440,9 @@ QMacStylePrivate::QMacStylePrivate(QMacStyle *style) bool QMacStylePrivate::animatable(QMacStylePrivate::Animates as, const QWidget *w) const { + if (!w) + return false; + if (as == AquaPushButton) { QPushButton *pb = const_cast<QPushButton *>(static_cast<const QPushButton *>(w)); if (w->window()->isActiveWindow() && pb && !mouseDown) { |