MessageCapture
Record the Qt messages a scope logs, so that a test can assert a diagnostic rather than hope for it (test-system-revamp §TSR-S-7, audit §TSR-Q-4.2).
In the namespace test. Declared in src/libs/libtest/test/MessageCapture.hpp.
Detailed description
While it lives, the capture is the message handler. A message passes the filter, or every message passes when there is none, and is recorded with its type. Then it goes on to the handler that was installed before, as forward says. The destructor restores that handler. Captures nest: the inner one forwards to the outer one.
A capture must end before the one it is nested in, as a scope does. A message can come from any thread, so the record is guarded. Six suites each installed their own handler until 2026-10-07. testMessageCapture tests it.