Details
Description
With respect to the streaming qDebug / qWarning / qCritical / qFatal functions, the Qt documentation says:
qWarning() << "Brush:" << myQBrush << "Other value:" << i;This syntax inserts a space between each item, and appends a newline at the end.
In fact, an extra space is printed out before the final newline, so it does not behave exactly as documented.
One of the notable effects of this is to make the usage of QTest::ignoreMessage quite confusing at times, e.g. consider the example:
QTest::ignoreMessage(QtWarningMsg, "foo1"); qWarning("foo1"); QTest::ignoreMessage(QtWarningMsg, "foo2"); qWarning() << "foo2";
This test would fail with message:
Did not receive message: "foo2"
...because the actual output message was "foo2 " (note trailing space).