From bfc32c590d797599ddfb814f023e5837c663ec23 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 10 Aug 2010 13:09:46 +0200 Subject: 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 --- src/gui/styles/qmacstyle_mac.mm | 3 +++ 1 file changed, 3 insertions(+) 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(static_cast(w)); if (w->window()->isActiveWindow() && pb && !mouseDown) { -- cgit v0.12