void MainWindow::onDataReceived(const QByteArray &data) { static int packetCount = 0; packetCount++; if (packetCount % 100 == 0) { qDebug() << "Received" << packetCount << "packets, latest size:" << data.size() << "bytes"; } }