diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/styles/windowsvista/qwindowsxpstyle.cpp | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index ff27cab98a..733b3a9e9c 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -122,7 +122,8 @@ static inline HDC hdcForWidgetBackingStore(const QWidget *widget) { if (QBackingStore *backingStore = backingStoreForWidget(widget)) { QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - return static_cast<HDC>(nativeInterface->nativeResourceForBackingStore(QByteArrayLiteral("getDC"), backingStore)); + if (nativeInterface) + return static_cast<HDC>(nativeInterface->nativeResourceForBackingStore(QByteArrayLiteral("getDC"), backingStore)); } return 0; } diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 9983cc7d9e..019fad3fc3 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -242,7 +242,7 @@ public: static HWND getHWNDForWidget(const QWidget *widget) { if (QWindow *window = windowForWidget(widget)) - if (window->handle()) + if (window->handle() && QGuiApplication::platformNativeInterface()) return static_cast<HWND> (QGuiApplication::platformNativeInterface()-> nativeResourceForWindow(QByteArrayLiteral("handle"), window)); return 0; |