QProcess signals connected.

This commit is contained in:
NissimHadar 2018-07-29 20:28:46 -07:00
parent e191c65290
commit 9247e8dc16
4 changed files with 21 additions and 12 deletions

View file

@ -242,8 +242,11 @@ void AssignmentClientMonitor::spawnChildClient() {
if (assignmentClient->processId() > 0) {
auto pid = assignmentClient->processId();
// make sure we hear that this process has finished when it does
connect(assignmentClient, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, [this, pid](int exitCode, QProcess::ExitStatus exitStatus) {
connect(
assignmentClient,
static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this,
[this, pid](int exitCode, QProcess::ExitStatus exitStatus) {
childProcessFinished(pid, exitCode, exitStatus);
});

View file

@ -285,12 +285,17 @@ void TestRailInterface::createAddTestCasesPythonScript(const QString& testDirect
QString command("C:\\Python37\\python");
QStringList parameters = QStringList() << outputDirectory + "/addTestCases.py";
QProcess* process = new QProcess();
if (process->startDetached(command, parameters)) {
QMessageBox::information(0, "Python process started", "TestRail is being updated");
} else {
QMessageBox::critical(0, "Failure", "Could not start process to update TestRail");
return;
}
connect(
process, &QProcess::started,
this, []() {QMessageBox::information(0, "Python process started", "TestRail is being updated"); }
);
connect(
process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, [](int exitCode, QProcess::ExitStatus exitStatus) {QMessageBox::information(0, "Python process finished", "TestRail tests have been added"); }
);
process->start(command, parameters);
}
}
@ -545,4 +550,4 @@ void TestRailInterface::processTestPython(const QString& fullDirectory,
<< "}\n";
stream << "case = client.send_post('add_case/' + str(section_id), data)\n";
}
}

View file

@ -16,7 +16,9 @@
#include <QtXml/QDomDocument>
#include <QString>
class TestRailInterface {
class TestRailInterface : public QObject{
Q_OBJECT
public:
TestRailInterface();

View file

@ -14,8 +14,7 @@
#include "../common.h"
class MismatchWindow : public QDialog, public Ui::MismatchWindow
{
class MismatchWindow : public QDialog, public Ui::MismatchWindow {
Q_OBJECT
public: