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();
|
||||
|
||||
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
|
||||
if (!nativeInterface)
|
||||
return; // Not Cocoa platform plugin.
|
||||
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
||||
nativeInterface->nativeResourceFunctionForIntegration("setContentBorderEnabled");
|
||||
if (!function)
|
||||
|
@ -360,6 +360,8 @@ void QToolBarLayout::updateMacBorderMetrics()
|
||||
return;
|
||||
|
||||
QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface();
|
||||
if (!nativeInterface)
|
||||
return; // Not Cocoa platform plugin.
|
||||
QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
|
||||
nativeInterface->nativeResourceFunctionForIntegration("registerContentBorderArea");
|
||||
if (!function)
|
||||
|
Loading…
Reference in New Issue
Block a user