diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:30:50 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 23:38:56 +0200 |
commit | c2d490a2385ea6f389340a296acaac0fa198c8b9 (patch) | |
tree | 5bc4dc681c9a9501cb9b2f39b8a1ab6e3d76ccfd /src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp | |
parent | 958cd3ee1094a068b6d0ff27c73a4b3caff088ad (diff) |
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp index 73a7c28b09..68dcd1add0 100644 --- a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp +++ b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp @@ -172,7 +172,7 @@ QQmlNativeDebugConnector::QQmlNativeDebugConnector() QQmlNativeDebugConnector::~QQmlNativeDebugConnector() { - for (QQmlDebugService *service : qAsConst(m_services)) { + for (QQmlDebugService *service : std::as_const(m_services)) { service->stateAboutToBeChanged(QQmlDebugService::NotConnected); service->setState(QQmlDebugService::NotConnected); service->stateChanged(QQmlDebugService::NotConnected); @@ -199,12 +199,12 @@ void QQmlNativeDebugConnector::addEngine(QJSEngine *engine) Q_ASSERT(!m_engines.contains(engine)); TRACE_PROTOCOL("Add engine to connector:" << engine); - for (QQmlDebugService *service : qAsConst(m_services)) + for (QQmlDebugService *service : std::as_const(m_services)) service->engineAboutToBeAdded(engine); announceObjectAvailability(QLatin1String("qmlengine"), engine, true); - for (QQmlDebugService *service : qAsConst(m_services)) + for (QQmlDebugService *service : std::as_const(m_services)) service->engineAdded(engine); m_engines.append(engine); @@ -215,12 +215,12 @@ void QQmlNativeDebugConnector::removeEngine(QJSEngine *engine) Q_ASSERT(m_engines.contains(engine)); TRACE_PROTOCOL("Remove engine from connector:" << engine); - for (QQmlDebugService *service : qAsConst(m_services)) + for (QQmlDebugService *service : std::as_const(m_services)) service->engineAboutToBeRemoved(engine); announceObjectAvailability(QLatin1String("qmlengine"), engine, false); - for (QQmlDebugService *service : qAsConst(m_services)) + for (QQmlDebugService *service : std::as_const(m_services)) service->engineRemoved(engine); m_engines.removeOne(engine); |