Obsolete Members for QTest

QTest 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。

(deprecated in 6.3) QVERIFY_EXCEPTION_THROWN(expression, exceptiontype)
(deprecated) QWARN(message)

宏文档

[deprecated in 6.3] QVERIFY_EXCEPTION_THROWN(expression, exceptiontype)

自 6.3 版起,该宏已被弃用。我们强烈建议不要在新代码中使用它。

请使用QVERIFY_THROWS_EXCEPTION(exceptiontype, expression)

[deprecated] QWARN(message)

该宏已被弃用。我们强烈建议不要在新代码中使用它。

请使用qWarning() 代替。

message 作为警告添加到测试日志中。此宏可在测试的任何地方使用。

注意:此宏是线程安全的

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.