[Qt-interest] How to disable window shadow on Mac?

John Weeks john at wavemetrics.com
Mon Aug 30 20:11:07 CEST 2010


On Aug 29, 2010, at 11:02 PM, Dmitry Savenko wrote:

> Firstly, one should add the following line to .pro file:
>     macx:LIBS += -framework Carbon
> After that, you can use the following code snippet to disable the
> shadow of a window.
>
> #ifdef Q_WS_MAC
>    #include <MacWindows.h>
> #endif
> // .....................
> void disableShadow(QWidget* window) {
> #ifdef Q_WS_MAC
>    HIViewRef view = (HIViewRef)window->winId();
>    WindowRef window = HIViewGetWindow(view);
>    ChangeWindowAttributes(window, kWindowNoShadowAttribute,
> kWindowNoAttributes);
> #endif
> }

Yes, this works, but the calls are deprecated. This won't work if you  
want to build with the Cocoa version of Qt, which is necessary if you  
want a 64-bit application.

Regards, John Weeks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100830/b3506414/attachment.html 


More information about the Qt-interest-old mailing list