Qt Remote objects done
This commit is contained in:
parent
048a673d31
commit
b2392c1943
15 changed files with 240 additions and 423 deletions
|
|
@ -3,25 +3,51 @@
|
|||
|
||||
IpcServerProcess::IpcServerProcess(QObject *parent) :
|
||||
IpcProcessInterfaceSource(parent),
|
||||
m_process(QSharedPointer<QProcess>(new QProcess(this)))
|
||||
m_process(QSharedPointer<QProcess>(new QProcess()))
|
||||
{
|
||||
connect(m_process.data(), &QProcess::errorOccurred, this, &IpcServerProcess::errorOccurred);
|
||||
connect(m_process.data(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &IpcServerProcess::finished);
|
||||
connect(m_process.data(), &QProcess::readyReadStandardError, this, &IpcServerProcess::readyReadStandardError);
|
||||
connect(m_process.data(), &QProcess::readyReadStandardOutput, this, &IpcServerProcess::readyReadStandardOutput);
|
||||
connect(m_process.data(), &QProcess::started, this, &IpcServerProcess::started);
|
||||
connect(m_process.data(), &QProcess::stateChanged, this, &IpcServerProcess::stateChanged);
|
||||
// connect(m_process.data(), &QProcess::errorOccurred, this, &IpcServerProcess::errorOccurred);
|
||||
// connect(m_process.data(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &IpcServerProcess::finished);
|
||||
// connect(m_process.data(), &QProcess::readyReadStandardError, this, &IpcServerProcess::readyReadStandardError);
|
||||
// connect(m_process.data(), &QProcess::readyReadStandardOutput, this, &IpcServerProcess::readyReadStandardOutput);
|
||||
// connect(m_process.data(), &QProcess::started, this, &IpcServerProcess::started);
|
||||
// connect(m_process.data(), &QProcess::stateChanged, this, &IpcServerProcess::stateChanged);
|
||||
|
||||
connect(m_process.data(), &QProcess::errorOccurred, [&](QProcess::ProcessError error){
|
||||
qDebug() << "IpcServerProcess errorOccurred " << error;
|
||||
});
|
||||
|
||||
connect(m_process.data(), &QProcess::readyReadStandardError, [&](){
|
||||
qDebug() << "IpcServerProcess StandardError " << m_process->readAllStandardError();
|
||||
|
||||
});
|
||||
connect(m_process.data(), &QProcess::readyReadStandardOutput, [&](){
|
||||
qDebug() << "IpcServerProcess StandardOutput " << m_process->readAllStandardOutput();
|
||||
|
||||
});
|
||||
|
||||
connect(m_process.data(), &QProcess::readyRead, [&](){
|
||||
qDebug() << "IpcServerProcess StandardOutput " << m_process->readAll();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void IpcServerProcess::start(const QString &program, const QStringList &args)
|
||||
void IpcServerProcess::start(const QString &program, const QStringList &arguments)
|
||||
{
|
||||
m_process->start(program, args);
|
||||
m_process->start(program, arguments);
|
||||
qDebug() << "IpcServerProcess started, " << arguments;
|
||||
|
||||
m_process->waitForStarted();
|
||||
qDebug() << "waitForStarted started, " << m_process->errorString();
|
||||
}
|
||||
|
||||
void IpcServerProcess::start()
|
||||
{
|
||||
m_process->start();
|
||||
qDebug() << "IpcServerProcess started, " << m_process->arguments();
|
||||
qDebug() << "IpcServerProcess started, " << m_process->program() << m_process->arguments();
|
||||
|
||||
m_process->waitForStarted();
|
||||
qDebug() << "waitForStarted , " << m_process->errorString() << m_process->error();
|
||||
}
|
||||
|
||||
void IpcServerProcess::close()
|
||||
|
|
@ -32,7 +58,6 @@ void IpcServerProcess::close()
|
|||
void IpcServerProcess::setArguments(const QStringList &arguments)
|
||||
{
|
||||
m_process->setArguments(arguments);
|
||||
qDebug() << "IpcServerProcess started, " << arguments;
|
||||
}
|
||||
|
||||
void IpcServerProcess::setInputChannelMode(QProcess::InputChannelMode mode)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class IpcServerProcess : public IpcProcessInterfaceSource
|
|||
public:
|
||||
explicit IpcServerProcess(QObject *parent = nullptr);
|
||||
|
||||
void start(const QString &program, const QStringList &args) override;
|
||||
void start(const QString &program, const QStringList &arguments) override;
|
||||
void start() override;
|
||||
void close() override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue