Revise the explanation for leaving QTest::qWait() as it is

The recently aborted attempt to act on the comment's recommendation
revealed a major performance regression, so mention that instead of
the now historical compiler problem that used to be our reason for not
simply calling qWaitFor().

Change-Id: I81714b556998217a833c21b4208118b7292b7a96
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Edward Welbourne 2022-01-12 17:07:53 +01:00 committed by Marc Mutz
parent e376c229e9
commit 95e4996688

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -107,9 +107,11 @@ Q_CORE_EXPORT void QTest::qSleep(int ms)
*/
Q_CORE_EXPORT void QTest::qWait(int ms)
{
// Ideally this method would be implemented in terms of qWaitFor, with
// a predicate that always returns false, but due to a compiler bug in
// GCC 6 we can't do that.
// Ideally this method would be implemented in terms of qWaitFor(), with a
// predicate that always returns false, but qWaitFor() uses the 1-arg overload
// of processEvents(), which doesn't handle events posted in this round of event
// processing, which, together with the 10ms qSleep() after every processEvents(),
// lead to a 10x slow-down in some webengine tests.
Q_ASSERT(QCoreApplication::instance());