From c2d490a2385ea6f389340a296acaac0fa198c8b9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 11:30:50 +0200 Subject: Port from qAsConst() to std::as_const() We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge --- tests/auto/qml/qqmlqt/tst_qqmlqt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/qml/qqmlqt') diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp index c3bf3b6181..220f449dfc 100644 --- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp +++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp @@ -885,7 +885,7 @@ void tst_qqmlqt::dateTimeFormattingVariants() << component.url().toString() + ":40: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed." << component.url().toString() + ":43: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed."; - for (const QString &warning : qAsConst(warnings)) + for (const QString &warning : std::as_const(warnings)) QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); warnings.clear(); @@ -899,7 +899,7 @@ void tst_qqmlqt::dateTimeFormattingVariants() << "Could not convert argument 1 at" << "expression for err_dateTime2@"; - for (const QString &warning : qAsConst(warnings)) + for (const QString &warning : std::as_const(warnings)) QTest::ignoreMessage(QtWarningMsg, QRegularExpression(warning)); warnings.clear(); -- cgit v1.2.3