Created
January 25, 2019 14:36
-
-
Save fernandoc1/49565c64057e1982898a8f7ed23013a5 to your computer and use it in GitHub Desktop.
QProcess::finished with lambda function example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QCoreApplication> | |
#include <QtGlobal> | |
#include <QDebug> | |
#include "global_settings.hpp" | |
int main(int argc, char** argv) | |
{ | |
QCoreApplication app(argc, argv); | |
GlobalSettings::loadConfig("config.json"); | |
QJsonValue scriptPath = GlobalSettings::value("get_inspection_analysis_images_path"); | |
QString scriptPathStr = scriptPath.toString(); | |
QStringList args; | |
args << scriptPathStr; | |
QProcess process; | |
process.start("/usr/bin/php", args); | |
QObject::connect(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), | |
[=](int exitCode, QProcess::ExitStatus exitStatus) | |
{ | |
qInfo() << "OK"; | |
}); | |
return app.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment