From 89b6e2d7041a82837915fefc2dfb1f6d5415cd83 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Apr 2012 11:06:41 +0200 Subject: Windows: Fix warning about retrieving the handle from non-toplevels. Change-Id: I967f218c98309e77371717aa16e46995a767caa3 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication_p.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index af7925c9d3..b1f510c5a5 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -346,8 +346,9 @@ public: static HWND getHWNDForWidget(const QWidget *widget) { if (QWindow *window = windowForWidget(widget)) - return static_cast (QGuiApplication::platformNativeInterface()-> - nativeResourceForWindow(QByteArrayLiteral("handle"), window)); + if (window->handle()) + return static_cast (QGuiApplication::platformNativeInterface()-> + nativeResourceForWindow(QByteArrayLiteral("handle"), window)); return 0; } #endif -- cgit v1.2.3