[Qt-interest] How to disable window shadow on Mac?
Dmitry Savenko
dsavenko at gmail.com
Tue Aug 31 05:31:42 CEST 2010
So, how to do it in a 'bullet-proof' way? Without deprecated calls and
compatible with both Carbon and Cocoa versions of Qt?
On Tue, Aug 31, 2010 at 1:11 AM, John Weeks <john at wavemetrics.com> wrote:
>
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list