Ruslan Polupan
23 октября 2017 г. 13:11

C++QProcess и ping

QProcess, PING

Возникла необходимость отображать в форме вывод команды пинг

void InfoObjectDialog::on_toolButtonPing_clicked()
{    if(ui->pingOutput->isHidden()) {
        ping = new QProcess(this);
        ping->setProcessChannelMode(QProcess::MergedChannels);
        connect( ping, SIGNAL(readyReadStandardOutput ()), this, SLOT(print_ping()) );
#ifdef Q_OS_WIN
     ping->start("ping", QStringList() << "-t" <<ip);
#else
     ping->start("ping", QStringList() << ip);
#endif
    } else 
Читать