diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index 18d4103fdfc..55f13a6b02a 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -481,7 +481,9 @@ QThreadPool *QThreadPoolPrivate::qtGuiInstance() { Q_CONSTINIT static QPointer guiInstance; Q_CONSTINIT static QBasicMutex theMutex; - + const static bool runtime_disable = qEnvironmentVariableIsSet("QT_NO_GUI_THREADPOOL"); + if (runtime_disable) + return nullptr; const QMutexLocker locker(&theMutex); if (guiInstance.isNull() && !QCoreApplication::closingDown()) { guiInstance = new QThreadPool();