Qt6: Adapt to removal of QProcess::setupChildProcess

And use QProcess::setChildProcessModifier when compiling against Qt6.

Task-number: QTCREATORBUG-24098
Change-Id: I4166a8e27f8f63dd661df119413cd2eb2ae1dc2e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2020-09-28 16:29:51 +02:00
parent df52de2828
commit 3433b8c24f
5 changed files with 48 additions and 2 deletions

View File

@@ -47,6 +47,9 @@ SshProcess::SshProcess()
env.set("DISPLAY", ":0");
}
setProcessEnvironment(env.toProcessEnvironment());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined(Q_OS_UNIX)
setChildProcessModifier([this] { setupChildProcess_impl(); });
#endif
}
SshProcess::~SshProcess()
@@ -62,7 +65,14 @@ SshProcess::~SshProcess()
waitForFinished(1000);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void SshProcess::setupChildProcess()
{
setupChildProcess_impl();
}
#endif
void SshProcess::setupChildProcess_impl()
{
#ifdef Q_OS_UNIX
setsid(); // Otherwise, ssh will ignore SSH_ASKPASS and read from /dev/tty directly.