From c39136ed4fb88dfbd5cb26925d4d9ca745571f05 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Mon, 7 Apr 2025 09:18:14 +0300 Subject: [PATCH] Make QProcess::splitCommand() available without process feature QProcess::splitCommand() is a static function that is used at least by Qt for Android without needing rest of the process-feature support (QProcess). Declare a simple QProcess class when the process-feature is not enabaled. This class makes the static splitCommand() function available. Fixes: QTBUG-135655 Change-Id: I97dc054c3007e98bd786cbe092ffc78e3cc201e5 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess.cpp | 2 ++ src/corelib/io/qprocess.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 57ddb664934..9ae22f68b8e 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2422,6 +2422,7 @@ void QProcessPrivate::start(QIODevice::OpenMode mode) errorString.clear(); startProcess(); } +#endif // QT_CONFIG(process) /*! \since 5.15 @@ -2472,6 +2473,7 @@ QStringList QProcess::splitCommand(QStringView command) return args; } +#if QT_CONFIG(process) /*! \since 5.0 diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index 8a25ba2b723..68352281667 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -291,6 +291,18 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QProcess::UnixProcessFlags) #endif +#else // !QT_CONFIG(process) + +class QProcess +{ +public: + Q_CORE_EXPORT static QStringList splitCommand(QStringView command); + +private: + QProcess() = delete; + Q_DISABLE_COPY_MOVE(QProcess) +}; + #endif // QT_CONFIG(process) QT_END_NAMESPACE