CAN: Bound the QCanBusDevice receive queue


Add non-virtual accessors for a frame count limit. Keep the oldest
frames that fit when a batch exceeds the limit, and trim the newest
frames when lowering the limit. Report ReceiveQueueOverflowError at
most once per overflow episode and per second. Reading a frame or
raising the limit to make room, disabling the limit, clearing input,
and calling readAllFrames() end an episode, including an empty
readAllFrames() call. Ignore negative limits so they cannot disable
a bound.

Emit framesReceived() before the overflow error so blocking receive
waits retain the error. Check the reporting rate after receive
callbacks to account for reentrant overflows. Cover queue bounds,
recovery, blocking waits, reentrancy and deletion in the tests. Check
the measured throttle interval to account for scheduling delays.

[ChangeLog][CAN][QCanBusDevice] Applications can bound the incoming
frame queue with setReceiveQueueLimit(). The default is unlimited.
Queue overflows are reported as ReceiveQueueOverflowError.

Fixes: QTBUG-149978
Assisted-by: OpenAI codex (gpt-6.1-sol)
Change-Id: I12a65df51706dde7bc39509b3906601f0213b514
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commit409c0ac0c603168be4256b283ff35deb3d5054d8
parente90cdda40a001639af2e2da6c15d19df29482f22
authorAndre Hartmann <aha_1980@gmx.de>
committerAndre Hartmann <aha_1980@gmx.de>
commit timeMon, 12 Oct 2026 17:49:10 +0000