From 7d11b50933ad6cfaebda1190d8d8b9ba470c8013 Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Wed, 24 Nov 2010 11:39:33 +0100 Subject: Add WA_MacNoShadow widget attribute Task-number: QTBUG-6831 Reviewed-by: Fabien Freling --- src/corelib/global/qnamespace.h | 2 ++ src/corelib/global/qnamespace.qdoc | 3 +++ src/gui/kernel/qwidget_mac.mm | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 3ed6291..6afc9a2 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -519,6 +519,8 @@ public: WA_X11DoNotAcceptFocus = 132, + WA_MacNoShadow = 133, + // Add new attributes before this line WA_AttributeCount }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f097f2a..b9939b6 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1257,6 +1257,9 @@ to this top level window. This attribute has no effect on non-X11 platforms. + \value WA_MacNoShadow Since Qt 4.8, this attribute disables drop shadows + for this top level window. Only affects Cocoa builds of Qt for Mac OS X. + \omitvalue WA_SetLayoutDirection \omitvalue WA_InputMethodTransparent \omitvalue WA_WState_CompressKeys diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 882f03b..bcddae5 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2294,7 +2294,10 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin } else { [windowRef setHidesOnDeactivate:NO]; } - [windowRef setHasShadow:YES]; + if (q->testAttribute(Qt::WA_MacNoShadow)) + [windowRef setHasShadow:NO]; + else + [windowRef setHasShadow:YES]; Q_UNUSED(parentWidget); Q_UNUSED(dialog); -- cgit v0.12