Make all objects created by QtcProcess children of it

Sometimes after creating QtcProcess we move it into a different
thread. In this case we should move all the children, too.
Without parent-child relation all the children will stay in the
old thread.

Change-Id: Ibde44d6153092a155dd2d200a7116a046910dddc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2021-09-02 17:03:49 +02:00
parent a454b3dc23
commit f7aa963a07
6 changed files with 28 additions and 23 deletions

View File

@@ -54,7 +54,7 @@ private:
class ProcessHelper : public QProcess
{
public:
ProcessHelper(QObject *parent = nullptr) : QProcess(parent)
ProcessHelper(QObject *parent) : QProcess(parent)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined(Q_OS_UNIX)
setChildProcessModifier([this] { setupChildProcess_impl(); });