QProcess* pConsoleProc = new QProcess;QByteArray returnData;QByteArray cmd = "top -n 1\n";pConsoleProc->start("/bin/sh");pConsoleProc->waitForStarted();pConsoleProc->write(cmd);pConsoleProc->waitForFinished();pConsoleProc->waitForReadyRead();returnData = pConsoleProc->readAllStandardOutput();pConsoleProc->close();delete pConsoleProc;return returnData;
Bashcat /proc/cpuinfocat /proc/meminfocat /proc/swaps