diff --git a/src/gui/util/qgraphicsframecapturemetal.mm b/src/gui/util/qgraphicsframecapturemetal.mm index ecb0ca9b03..91c0b924e4 100644 --- a/src/gui/util/qgraphicsframecapturemetal.mm +++ b/src/gui/util/qgraphicsframecapturemetal.mm @@ -27,7 +27,7 @@ QGraphicsFrameCaptureMetal::QGraphicsFrameCaptureMetal() QGraphicsFrameCaptureMetal::~QGraphicsFrameCaptureMetal() { -#ifdef Q_OS_MACOS +#if defined(Q_OS_MACOS) && QT_CONFIG(process) if (m_process) { m_process->terminate(); delete m_process; @@ -131,7 +131,10 @@ bool QGraphicsFrameCaptureMetal::isCapturing() const void QGraphicsFrameCaptureMetal::openCapture() { -#ifdef Q_OS_MACOS +#if defined(Q_OS_MACOS) +#if !QT_CONFIG(process) + qFatal("QGraphicsFrameCapture requires QProcess on macOS"); +#else if (!initialized()) { qCWarning(lcGraphicsFrameCapture) << "Capturing on Metal was not initialized. Can not open XCode with a valid capture."; return; @@ -148,6 +151,7 @@ void QGraphicsFrameCaptureMetal::openCapture() m_process->kill(); m_process->start(); #endif +#endif } void QGraphicsFrameCaptureMetal::updateCaptureFileName() diff --git a/src/gui/util/qgraphicsframecapturemetal_p_p.h b/src/gui/util/qgraphicsframecapturemetal_p_p.h index ffa8404d25..d703949de2 100644 --- a/src/gui/util/qgraphicsframecapturemetal_p_p.h +++ b/src/gui/util/qgraphicsframecapturemetal_p_p.h @@ -42,7 +42,7 @@ public: private: void updateCaptureFileName(); -#ifdef Q_OS_MACOS +#if defined(Q_OS_MACOS) && QT_CONFIG(process) QProcess *m_process = nullptr; #endif MTLCaptureManager *m_captureManager = nullptr;