![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qmessagespy_p.h>
Classes | |
| class | WaitToken |
Public Member Functions | |
| QMessageSpy (const QLoggingCategory &category) | |
| QMessageSpy (QLatin1StringView category={}) | |
| ~QMessageSpy () | |
| WaitToken | expect (QtMsgType type, const QString &message) |
| Register an expectation for a message of type matching message exactly. | |
| WaitToken | expect (QtMsgType type, const QRegularExpression &pattern) |
| Register an expectation for a message of type matching pattern. | |
QMessageSpy intercepts Qt logging messages via qInstallMessageHandler. Messages matching a pending expect() are silently consumed; all other messages are forwarded to the previous handler (e.g. QTest's default).
Usage:
Multiple waiters are supported simultaneously.
Definition at line 103 of file qmessagespy_p.h.
|
inlineexplicit |
Definition at line 145 of file qmessagespy_p.h.
|
inlineexplicit |
Definition at line 150 of file qmessagespy_p.h.
|
inline |
Definition at line 160 of file qmessagespy_p.h.
|
inlinenodiscard |
Register an expectation for a message of type matching pattern.
Definition at line 185 of file qmessagespy_p.h.
|
inlinenodiscard |
Register an expectation for a message of type matching message exactly.
Returns a WaitToken; call wait() on it after triggering the message. The matching message is consumed (not forwarded to the previous handler).
Definition at line 172 of file qmessagespy_p.h.