Hi,
Not a good aproach to use an infinite loop and breaking it on this way.
Use 2 QTimers:
-First one that will fire ever X ms(depending on Baud Rate you have to calculate this) and will take a look if there is data avaiable.
When the first timer fires, take a look if there is data to read, if there isn't, you have to check if the secon timer is started, if not started, start it.
The second one will fire if you have not readed any data in 10 seconds. This will be a singleShot timer. When it fires, stop the first timer.
Bookmarks