Docs: improve the example of reading from port
QSerialPort is derived from QIODevice, and QIODevice::read() has always
returned qint64, not int.
So, update the type of the numRead and numReadTotal variables.
As a drive-by, move the numRead variable inside the loop, because
pre-declaring it is actually a bad practice in modern C++. This
also allows to make it const.
Fixes: QTBUG-109455
Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Ie1f28213aae61e6df4fc3a80a274aafae8156e16
Reviewed-by: Marc Mutz <marc.mutz@qt.io>