QProcess 小问题
cmd = new QProcess();
connect(cmd, SIGNAL(started()), this, SLOT(started()));
connect(cmd, SIGNAL(readyRead()), this, SLOT(readOutput()));
cmd->start("ping 192.168.1.1");
}
void WIFI::started ()
{
}
void WIFI::readOutput()
{
QString test = cmd->readAll();
qDebug() << test;
}
为什么一致得不到ping 的结果啊。 走不到test
[解决办法]
Signalsvoid error ( QProcess::ProcessError error )void finished ( int exitCode, QProcess::ExitStatus exitStatus )void readyReadStandardError ()void readyReadStandardOutput ()void started ()void stateChanged ( QProcess::ProcessState newState )