Check platformNativeInterface pointer before dereferencing
QApplication::platformNativeInterface() returns null if started with -platform offscreen. Fixes: QTBUG-80946 Change-Id: I3ad03ad27148c8576bd3fab0b136827bb8d171ae Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
a63969081c
commit
4b1d370f75
@ -1364,6 +1364,8 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
|
|||||||
createWinId();
|
createWinId();
|
||||||
|
|
||||||
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
|
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
|
||||||
|
if (!nativeInterface)
|
||||||
|
return; // Not Cocoa platform plugin.
|
||||||
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
||||||
nativeInterface->nativeResourceFunctionForIntegration("setContentBorderEnabled");
|
nativeInterface->nativeResourceFunctionForIntegration("setContentBorderEnabled");
|
||||||
if (!function)
|
if (!function)
|
||||||
|
@ -360,6 +360,8 @@ void QToolBarLayout::updateMacBorderMetrics()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface();
|
QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface();
|
||||||
|
if (!nativeInterface)
|
||||||
|
return; // Not Cocoa platform plugin.
|
||||||
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
||||||
nativeInterface->nativeResourceFunctionForIntegration("registerContentBorderArea");
|
nativeInterface->nativeResourceFunctionForIntegration("registerContentBorderArea");
|
||||||
if (!function)
|
if (!function)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user