Labels

03/05/2012

Display Current System IP Address

arguments << "-c" << "ifconfig wlan0 | grep 'inet ' | awk '{print $2}' | sed 's/addr://'";
// or arguments << "-c" << "ifconfig eth1 | grep 'inet ' | awk '{print $2}' | sed 's/addr://'";
QProcess* process = new QProcess(this);
process->start(prog , arguments);
process->waitForFinished();
QString tmp = process->readAll();
//qDebug() << tmp;
ui->label_ip->setText(tmp);