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 /tests/auto/qml/debugger | |
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 'tests/auto/qml/debugger')
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index 5a8fce6424..ab599e9a23 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -150,7 +150,7 @@ void tst_QQmlDebuggingEnabler::custom() m_clients = QQmlDebugTest::createOtherClients(m_connection); m_connection->connectToHost("127.0.0.1", m_process->debugPort()); QVERIFY(m_connection->waitForConnected()); - for (QQmlDebugClient *client : qAsConst(m_clients)) + for (QQmlDebugClient *client : std::as_const(m_clients)) QCOMPARE(client->state(), (services.isEmpty() || services.contains(client->name())) ? QQmlDebugClient::Enabled : QQmlDebugClient::Unavailable); } diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 2e457cad8f..dfe92bb80b 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -469,32 +469,32 @@ void tst_QQmlProfilerService::cleanup() if (m_client && QTest::currentTestFailed()) { qDebug() << "QML Messages:" << m_client->qmlMessages.size(); int i = 0; - for (const QQmlProfilerEvent &data : qAsConst(m_client->qmlMessages)) + for (const QQmlProfilerEvent &data : std::as_const(m_client->qmlMessages)) log(data, i++); qDebug() << " "; qDebug() << "JavaScript Messages:" << m_client->javascriptMessages.size(); i = 0; - for (const QQmlProfilerEvent &data : qAsConst(m_client->javascriptMessages)) + for (const QQmlProfilerEvent &data : std::as_const(m_client->javascriptMessages)) log(data, i++); qDebug() << " "; qDebug() << "Asynchronous Messages:" << m_client->asynchronousMessages.size(); i = 0; - for (const QQmlProfilerEvent &data : qAsConst(m_client->asynchronousMessages)) + for (const QQmlProfilerEvent &data : std::as_const(m_client->asynchronousMessages)) log(data, i++); qDebug() << " "; qDebug() << "Pixmap Cache Messages:" << m_client->pixmapMessages.size(); i = 0; - for (const QQmlProfilerEvent &data : qAsConst(m_client->pixmapMessages)) + for (const QQmlProfilerEvent &data : std::as_const(m_client->pixmapMessages)) log(data, i++); qDebug() << " "; qDebug() << "Javascript Heap Messages:" << m_client->jsHeapMessages.size(); i = 0; - for (const QQmlProfilerEvent &data : qAsConst(m_client->jsHeapMessages)) + for (const QQmlProfilerEvent &data : std::as_const(m_client->jsHeapMessages)) log(data, i++); qDebug() << " "; |