Mac: Fix warnings about non-existing native Windows on startup.

Shown for example by Qt Designer.

Change-Id: Ia866a93a781a027aa3703f44314954888d75d436
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Friedemann Kleint 2013-04-17 09:59:52 +02:00 committed by The Qt Project
parent 8e27fcb3fe
commit b982679940

View File

@ -661,11 +661,11 @@ static CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget)
bool qt_macWindowIsTextured(const QWidget *window)
{
NSWindow *nswindow = static_cast<NSWindow*>(
QApplication::platformNativeInterface()->nativeResourceForWindow("NSWindow", window->windowHandle()));
if (!nswindow)
return false;
if (QWindow *w = window->windowHandle())
if (w->handle())
if (NSWindow *nswindow = static_cast<NSWindow*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("NSWindow"), w)))
return ([nswindow styleMask] & NSTexturedBackgroundWindowMask) ? true : false;
return false;
}
/*****************************************************************************