diff options
Diffstat (limited to 'src/sysInfo.cpp')
| -rw-r--r-- | src/sysInfo.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/sysInfo.cpp b/src/sysInfo.cpp index f5cd18d..7cf2124 100644 --- a/src/sysInfo.cpp +++ b/src/sysInfo.cpp @@ -82,9 +82,37 @@ QString sysInfo::getAllInfos(){ infos.insert("mac", getMACAddress()); infos.insert("ip", getIPAddress()); - QJson::Serializer serializer; + //QJson::Serializer serializer; QByteArray json = serializer.serialize(infos); if (debug) qDebug() << json; return json; } +// +QStringList sysInfo::getPrcOutP2() +{ + QString cmd = "echo test"; + QProcess *process = new QProcess(); + qDebug()<<"try to open: "<<cmd; + process->start(cmd, QIODevice::ReadOnly); + + if (!process->waitForStarted() ) + qDebug()<<"process couldn't get opened"; + + QStringList output; + process->waitForFinished(); + + QTextStream *txt_stream = new QTextStream(process); + + while(!txt_stream->atEnd() ) + { + qDebug()<<"read output: "; + QString tmp_str = txt_stream->readLine(); + output.append(tmp_str); + qDebug()<<tmp_str; + } + + qDebug()<<"process finished: "; + return output; +} + |
