QHostAddress test; if (!test.setAddress("111.111.111.1")) { ui->statusBar->showMessage("ERROR : Invalid ip address."); return; }