From aa37e67ef7f5ff22da0ef95fb5221bc1fff9b3ca Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 11:08:21 +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, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev --- src/tools/uic/cpp/cppwriteinitialization.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp') diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 4ccda8e11e1..24ca25e8eec 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -513,7 +513,7 @@ void WriteInitialization::acceptUI(DomUI *node) if (!m_buddies.empty()) m_output << language::openQtConfig(shortcutConfigKey()); - for (const Buddy &b : qAsConst(m_buddies)) { + for (const Buddy &b : std::as_const(m_buddies)) { const QString buddyVarName = m_driver->widgetVariableName(b.buddyAttributeName); if (buddyVarName.isEmpty()) { fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n", @@ -2734,7 +2734,7 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp m_setupUiStream << language::closeQtConfig(it.key()); ++it; } - for (Item *child : qAsConst(m_children)) + for (Item *child : std::as_const(m_children)) child->writeSetupUi(uniqueName); return uniqueName; } -- cgit v1.2.3