From 13bb9fcdae69df6e12641a080a6796493b97dd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 24 Oct 2023 13:24:52 +0200 Subject: [PATCH] no-thread: add QProcess config check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable QGraphicsFrameCapture for the no-thread (and no-process) configuration. Change-Id: I7767098efff78338a763ff192512d484cd300c1d Reviewed-by: Tor Arne Vestbø --- src/gui/util/qgraphicsframecapturemetal.mm | 8 ++++++-- src/gui/util/qgraphicsframecapturemetal_p_p.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) 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;