diff options
-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 |