summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-08-10 11:09:46 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-08-10 11:12:30 (GMT)
commitbfc32c590d797599ddfb814f023e5837c663ec23 (patch)
tree507975af7d86d0a1d03254fef086a99bfe985c04
parent5f225d68ad6f85fd026bd28d1cdf6010b9555b07 (diff)
downloadQt-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
-rw-r--r--src/gui/styles/qmacstyle_mac.mm3
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) {