Implement writing to process inside process launcher

Change-Id: I7321a941024d431cc52b3f6ae0b1ef38d851db8c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-08-06 14:43:03 +02:00
parent 7696f4f37c
commit 535d312e93
7 changed files with 61 additions and 2 deletions

View File

@@ -333,6 +333,18 @@ void LauncherHandle::start(const QString &program, const QStringList &arguments,
doStart();
}
qint64 LauncherHandle::write(const QByteArray &data)
{
QMutexLocker locker(&m_mutex);
if (m_processState != QProcess::Running)
return -1;
WritePacket p(m_token);
p.inputData = data;
sendPacket(p);
}
// Ensure it's called from caller's thread, after moving LauncherHandle into the launcher's thread
void LauncherHandle::createCallerHandle()
{