void mainForm::slotPendingData(){ while(udpSocket->hasPendingDatagrams()) { QByteArray datagram; datagram.resize(udpSocket->pendingDatagramSize()); udpSocket->readDatagram(datagram.data(),datagram.size()); QMessageBox::information(0,tr("Message"),tr("%1").arg(datagram.data()),QMessageBox::Ok); }}