diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-04-27 11:06:41 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-27 20:16:09 +0200 |
commit | 89b6e2d7041a82837915fefc2dfb1f6d5415cd83 (patch) | |
tree | 2925d89a3013ec299408ae6c3d7a68e19d08ab5e /src/widgets/kernel/qapplication_p.h | |
parent | bf4a4a106fdb16bb65ebebc1355260cb1d948202 (diff) |
Windows: Fix warning about retrieving the handle from non-toplevels.
Change-Id: I967f218c98309e77371717aa16e46995a767caa3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/widgets/kernel/qapplication_p.h')
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
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<HWND> (QGuiApplication::platformNativeInterface()-> - nativeResourceForWindow(QByteArrayLiteral("handle"), window)); + if (window->handle()) + return static_cast<HWND> (QGuiApplication::platformNativeInterface()-> + nativeResourceForWindow(QByteArrayLiteral("handle"), window)); return 0; } #endif |