Clean up multicast examples

They're small, not much to polish.

Pick-to: 6.5
Change-Id: Iada573504de557ab18381370bb9760b1f60cc2e4
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2023-03-09 15:44:50 +01:00
parent 7c23aa6bc5
commit 58dfb10781
7 changed files with 10 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -3,10 +3,12 @@
/*!
\example multicastreceiver
\title Multicast Receiver Example
\title Multicast Receiver
\meta category {Networking}
\meta tags {network,multicast,ipv6,ipv4,udp}
\ingroup examples-network
\brief Demonstrates how to receive information sent to a multicast group.
This example demonstrates how to receive messages sent to a multicast group
\image multicastreceiver-example.png
This example demonstrates how to receive messages sent to a multicast group.
\image multicastreceiver-example.webp
*/

View File

@ -3,12 +3,14 @@
/*!
\example multicastsender
\title Multicast Sender Example
\title Multicast Sender
\meta category {Networking}
\meta tags {network,multicast,ipv6,ipv4,udp}
\ingroup examples-network
\brief Demonstrates how to send messages to a multicast group.
This example demonstrates how to send messages to the clients of a
multicast group.
\image multicastsender-example.png
\image multicastsender-example.webp
*/

View File

@ -47,7 +47,7 @@ void Receiver::processPendingDatagrams()
// using QUdpSocket::readDatagram (API since Qt 4)
while (udpSocket4.hasPendingDatagrams()) {
datagram.resize(int(udpSocket4.pendingDatagramSize()));
datagram.resize(qsizetype(udpSocket4.pendingDatagramSize()));
udpSocket4.readDatagram(datagram.data(), datagram.size());
statusLabel->setText(tr("Received IPv4 datagram: \"%1\"")
.arg(datagram.constData()));