diff options
Diffstat (limited to 'src/plugins/qmltooling')
10 files changed, 50 insertions, 50 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp index 6ad9c6f0ac..a1d07e6654 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp @@ -73,7 +73,7 @@ void QV4DebuggerAgent::addDebugger(QV4Debugger *debugger) debugger->setBreakOnThrow(m_breakOnThrow); - for (const BreakPoint &breakPoint : qAsConst(m_breakPoints)) + for (const BreakPoint &breakPoint : std::as_const(m_breakPoints)) if (breakPoint.enabled) debugger->addBreakPoint(breakPoint.fileName, breakPoint.lineNr, breakPoint.condition); @@ -120,7 +120,7 @@ void QV4DebuggerAgent::resumeAll() const int QV4DebuggerAgent::addBreakPoint(const QString &fileName, int lineNumber, bool enabled, const QString &condition) { if (enabled) { - for (QV4Debugger *debugger : qAsConst(m_debuggers)) + for (QV4Debugger *debugger : std::as_const(m_debuggers)) debugger->addBreakPoint(fileName, lineNumber, condition); } @@ -138,7 +138,7 @@ void QV4DebuggerAgent::removeBreakPoint(int id) m_breakPoints.remove(id); if (breakPoint.enabled) - for (QV4Debugger *debugger : qAsConst(m_debuggers)) + for (QV4Debugger *debugger : std::as_const(m_debuggers)) debugger->removeBreakPoint(breakPoint.fileName, breakPoint.lineNr); } @@ -155,7 +155,7 @@ void QV4DebuggerAgent::enableBreakPoint(int id, bool onoff) return; breakPoint.enabled = onoff; - for (QV4Debugger *debugger : qAsConst(m_debuggers)) { + for (QV4Debugger *debugger : std::as_const(m_debuggers)) { if (onoff) debugger->addBreakPoint(breakPoint.fileName, breakPoint.lineNr, breakPoint.condition); else @@ -178,14 +178,14 @@ void QV4DebuggerAgent::setBreakOnThrow(bool onoff) { if (onoff != m_breakOnThrow) { m_breakOnThrow = onoff; - for (QV4Debugger *debugger : qAsConst(m_debuggers)) + for (QV4Debugger *debugger : std::as_const(m_debuggers)) debugger->setBreakOnThrow(onoff); } } void QV4DebuggerAgent::clearAllPauseRequests() { - for (QV4Debugger *debugger : qAsConst(m_debuggers)) + for (QV4Debugger *debugger : std::as_const(m_debuggers)) debugger->clearPauseRequest(); } diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp index 64f0f89ae0..7b9d74a030 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp @@ -734,7 +734,7 @@ void QV4DebugServiceImpl::signalEmitted(const QString &signal) //Normalize to Lower case. QString signalName = signal.left(signal.indexOf(QLatin1Char('('))).toLower(); - for (const QString &signal : qAsConst(breakOnSignals)) { + for (const QString &signal : std::as_const(breakOnSignals)) { if (signal == signalName) { // TODO: pause debugger break; diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp index f4e90f87ca..fb9ec74dc6 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp @@ -192,7 +192,7 @@ void GlobalInspector::removeWindow(QQuickWindow *window) void GlobalInspector::setParentWindow(QQuickWindow *window, QWindow *parentWindow) { - for (QmlJSDebugger::QQuickWindowInspector *inspector : qAsConst(m_windowInspectors)) { + for (QmlJSDebugger::QQuickWindowInspector *inspector : std::as_const(m_windowInspectors)) { if (inspector->quickWindow() == window) inspector->setParentWindow(parentWindow); } @@ -222,7 +222,7 @@ bool GlobalInspector::syncSelectedItems(const QList<QQuickItem *> &items) selectionChanged = true; connect(item, &QObject::destroyed, this, &GlobalInspector::removeFromSelectedItems); m_selectedItems.append(item); - for (QQuickWindowInspector *inspector : qAsConst(m_windowInspectors)) { + for (QQuickWindowInspector *inspector : std::as_const(m_windowInspectors)) { if (inspector->isEnabled() && inspector->quickWindow() == item->window()) { m_highlightItems.insert(item, new SelectionHighlight(titleForItem(item), item, inspector->overlay())); @@ -284,12 +284,12 @@ void GlobalInspector::processMessage(const QByteArray &message) ds >> requestId >> command; if (command == ENABLE) { - for (QQuickWindowInspector *inspector : qAsConst(m_windowInspectors)) + for (QQuickWindowInspector *inspector : std::as_const(m_windowInspectors)) inspector->setEnabled(true); success = !m_windowInspectors.isEmpty(); } else if (command == DISABLE) { setSelectedItems(QList<QQuickItem*>()); - for (QQuickWindowInspector *inspector : qAsConst(m_windowInspectors)) + for (QQuickWindowInspector *inspector : std::as_const(m_windowInspectors)) inspector->setEnabled(false); success = !m_windowInspectors.isEmpty(); } else if (command == SELECT) { @@ -297,7 +297,7 @@ void GlobalInspector::processMessage(const QByteArray &message) ds >> debugIds; QList<QQuickItem *> selectedObjects; - for (int debugId : qAsConst(debugIds)) { + for (int debugId : std::as_const(debugIds)) { if (QQuickItem *obj = qobject_cast<QQuickItem *>(QQmlDebugService::objectForId(debugId))) selectedObjects << obj; @@ -311,7 +311,7 @@ void GlobalInspector::processMessage(const QByteArray &message) } else if (command == SHOW_APP_ON_TOP) { bool showOnTop; ds >> showOnTop; - for (QmlJSDebugger::QQuickWindowInspector *inspector : qAsConst(m_windowInspectors)) + for (QmlJSDebugger::QQuickWindowInspector *inspector : std::as_const(m_windowInspectors)) inspector->setShowAppOnTop(showOnTop); success = !m_windowInspectors.isEmpty(); } else if (command == CREATE_OBJECT) { 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); diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp index 16f62d00d2..10d52c75ee 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp @@ -260,7 +260,7 @@ void NativeDebugger::signalEmitted(const QString &signal) //Normalize to Lower case. QString signalName = signal.left(signal.indexOf(QLatin1Char('('))).toLower(); - for (const QString &signal : qAsConst(breakOnSignals)) { + for (const QString &signal : std::as_const(breakOnSignals)) { if (signal == signalName) { // TODO: pause debugger break; @@ -710,7 +710,7 @@ void QQmlNativeDebugServiceImpl::engineAboutToBeRemoved(QJSEngine *engine) void QQmlNativeDebugServiceImpl::stateAboutToBeChanged(QQmlDebugService::State state) { if (state == Enabled) { - for (NativeDebugger *debugger : qAsConst(m_debuggers)) { + for (NativeDebugger *debugger : std::as_const(m_debuggers)) { QV4::ExecutionEngine *engine = debugger->engine(); if (!engine->debugger()) engine->setDebugger(debugger); @@ -734,7 +734,7 @@ void QQmlNativeDebugServiceImpl::messageReceived(const QByteArray &message) } else if (cmd == QLatin1String("echo")) { response.insert(QStringLiteral("result"), arguments); } else { - for (NativeDebugger *debugger : qAsConst(m_debuggers)) + for (NativeDebugger *debugger : std::as_const(m_debuggers)) if (debugger) debugger->handleCommand(&response, cmd, arguments); } diff --git a/src/plugins/qmltooling/qmldbg_preview/proxytranslator.cpp b/src/plugins/qmltooling/qmldbg_preview/proxytranslator.cpp index 557d6a0082..d0004455d7 100644 --- a/src/plugins/qmltooling/qmldbg_preview/proxytranslator.cpp +++ b/src/plugins/qmltooling/qmldbg_preview/proxytranslator.cpp @@ -64,14 +64,14 @@ void ProxyTranslator::setLanguage(const QUrl &context, const QLocale &locale) } // unfortunately setUiLanguage set new translators, so do this first - for (QQmlEngine *engine : qAsConst(m_engines)) + for (QQmlEngine *engine : std::as_const(m_engines)) engine->setUiLanguage(locale.bcp47Name()); // make sure proxy translator is the first used translator QCoreApplication::removeTranslator(this); QCoreApplication::installTranslator(this); - for (QQmlEngine *engine : qAsConst(m_engines)) { + for (QQmlEngine *engine : std::as_const(m_engines)) { // have two retranslate runs to get elided warning even the same language was set m_enable = false; engine->retranslate(); diff --git a/src/plugins/qmltooling/qmldbg_preview/qqmldebugtranslationservice.cpp b/src/plugins/qmltooling/qmldbg_preview/qqmldebugtranslationservice.cpp index 859f89367f..04d18b66ef 100644 --- a/src/plugins/qmltooling/qmldbg_preview/qqmldebugtranslationservice.cpp +++ b/src/plugins/qmltooling/qmldbg_preview/qqmldebugtranslationservice.cpp @@ -109,7 +109,7 @@ public: if (s == false) qWarning() << "disable WatchTextElides is not implemented"; watchTextElides = s; - for (auto &&information : qAsConst(objectTranslationBindingMultiMap)) { + for (auto &&information : std::as_const(objectTranslationBindingMultiMap)) { QObject *scopeObject = information.scopeObject; int elideIndex = scopeObject->metaObject()->indexOfProperty("elide"); if (elideIndex >= 0) { @@ -143,7 +143,7 @@ public: QVector<QmlElement> qmlElements; - for (auto &&information : qAsConst(objectTranslationBindingMultiMap)) { + for (auto &&information : std::as_const(objectTranslationBindingMultiMap)) { QObject *scopeObject = information.scopeObject; auto compilationUnit = information.compilationUnit; @@ -209,7 +209,7 @@ public: packet << Reply::TranslationIssues; QVector<TranslationIssue> issues; - for (auto &&information : qAsConst(objectTranslationBindingMultiMap)) { + for (auto &&information : std::as_const(objectTranslationBindingMultiMap)) { if (!proxyTranslator->hasTranslation(information)) { TranslationIssue issue; issue.type = TranslationIssue::Type::Missing; diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp index 164d01970e..819d46b124 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp @@ -91,10 +91,10 @@ void QQmlEngineControlServiceImpl::stateChanged(State) { // We flush everything for any kind of state change, to avoid complicated timing issues. QMutexLocker lock(&dataMutex); - for (QJSEngine *engine : qAsConst(startingEngines)) + for (QJSEngine *engine : std::as_const(startingEngines)) emit attachedToEngine(engine); startingEngines.clear(); - for (QJSEngine *engine : qAsConst(stoppingEngines)) + for (QJSEngine *engine : std::as_const(stoppingEngines)) emit detachedFromEngine(engine); stoppingEngines.clear(); } diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp index bf70008775..614890a8fd 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp @@ -67,8 +67,8 @@ void QQmlProfilerServiceImpl::dataReady(QQmlAbstractProfilerAdapter *profiler) m_startTimes.insert(0, profiler); if (dataComplete) { QList<QJSEngine *> enginesToRelease; - for (QJSEngine *engine : qAsConst(m_stoppingEngines)) { - const auto range = qAsConst(m_engineProfilers).equal_range(engine); + for (QJSEngine *engine : std::as_const(m_stoppingEngines)) { + const auto range = std::as_const(m_engineProfilers).equal_range(engine); const auto startTimesEnd = m_startTimes.cend(); for (auto it = range.first; it != range.second; ++it) { if (std::find(m_startTimes.cbegin(), startTimesEnd, *it) != startTimesEnd) { @@ -78,7 +78,7 @@ void QQmlProfilerServiceImpl::dataReady(QQmlAbstractProfilerAdapter *profiler) } } sendMessages(); - for (QJSEngine *engine : qAsConst(enginesToRelease)) { + for (QJSEngine *engine : std::as_const(enginesToRelease)) { m_stoppingEngines.removeOne(engine); emit detachedFromEngine(engine); } @@ -114,7 +114,7 @@ void QQmlProfilerServiceImpl::engineAdded(QJSEngine *engine) if (m_globalEnabled) startProfiling(engine, m_globalFeatures); - const auto range = qAsConst(m_engineProfilers).equal_range(engine); + const auto range = std::as_const(m_engineProfilers).equal_range(engine); for (auto it = range.first; it != range.second; ++it) (*it)->stopWaiting(); } @@ -126,7 +126,7 @@ void QQmlProfilerServiceImpl::engineAboutToBeRemoved(QJSEngine *engine) QMutexLocker lock(&m_configMutex); bool isRunning = false; - const auto range = qAsConst(m_engineProfilers).equal_range(engine); + const auto range = std::as_const(m_engineProfilers).equal_range(engine); for (auto it = range.first; it != range.second; ++it) { QQmlAbstractProfilerAdapter *profiler = *it; if (profiler->isRunning()) @@ -147,7 +147,7 @@ void QQmlProfilerServiceImpl::engineRemoved(QJSEngine *engine) "QML profilers have to be removed from the engine thread"); QMutexLocker lock(&m_configMutex); - const auto range = qAsConst(m_engineProfilers).equal_range(engine); + const auto range = std::as_const(m_engineProfilers).equal_range(engine); for (auto it = range.first; it != range.second; ++it) { QQmlAbstractProfilerAdapter *profiler = *it; removeProfilerFromStartTimes(profiler); @@ -172,7 +172,7 @@ void QQmlProfilerServiceImpl::addGlobalProfiler(QQmlAbstractProfilerAdapter *pro // Global profilers are started whenever any engine profiler is started and stopped when // all engine profilers are stopped. quint64 features = 0; - for (QQmlAbstractProfilerAdapter *engineProfiler : qAsConst(m_engineProfilers)) + for (QQmlAbstractProfilerAdapter *engineProfiler : std::as_const(m_engineProfilers)) features |= engineProfiler->features(); if (features != 0) @@ -220,7 +220,7 @@ void QQmlProfilerServiceImpl::startProfiling(QJSEngine *engine, quint64 features d << m_timer.nsecsElapsed() << static_cast<qint32>(Event) << static_cast<qint32>(StartTrace); bool startedAny = false; if (engine != nullptr) { - const auto range = qAsConst(m_engineProfilers).equal_range(engine); + const auto range = std::as_const(m_engineProfilers).equal_range(engine); for (auto it = range.first; it != range.second; ++it) { QQmlAbstractProfilerAdapter *profiler = *it; if (!profiler->isRunning()) { @@ -243,12 +243,12 @@ void QQmlProfilerServiceImpl::startProfiling(QJSEngine *engine, quint64 features startedAny = true; } } - for (QJSEngine *profiledEngine : qAsConst(engines)) + for (QJSEngine *profiledEngine : std::as_const(engines)) d << idForObject(profiledEngine); } if (startedAny) { - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(m_globalProfilers)) { + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(m_globalProfilers)) { if (!profiler->isRunning()) profiler->startProfiling(features); } @@ -291,7 +291,7 @@ void QQmlProfilerServiceImpl::stopProfiling(QJSEngine *engine) if (stopping.isEmpty()) return; - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(m_globalProfilers)) { + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(m_globalProfilers)) { if (!profiler->isRunning()) continue; m_startTimes.insert(-1, profiler); @@ -305,10 +305,10 @@ void QQmlProfilerServiceImpl::stopProfiling(QJSEngine *engine) emit stopFlushTimer(); m_waitingForStop = true; - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(reporting)) + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(reporting)) profiler->reportData(); - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(stopping)) + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(stopping)) profiler->stopProfiling(); } @@ -325,7 +325,7 @@ void QQmlProfilerServiceImpl::sendMessages() << static_cast<qint32>(EndTrace); QSet<QJSEngine *> seen; - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(m_startTimes)) { + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(m_startTimes)) { for (QMultiHash<QJSEngine *, QQmlAbstractProfilerAdapter *>::iterator i(m_engineProfilers.begin()); i != m_engineProfilers.end(); ++i) { if (i.value() == profiler && !seen.contains(i.key())) { @@ -352,7 +352,7 @@ void QQmlProfilerServiceImpl::sendMessages() } bool stillRunning = false; - for (const QQmlAbstractProfilerAdapter *profiler : qAsConst(m_engineProfilers)) { + for (const QQmlAbstractProfilerAdapter *profiler : std::as_const(m_engineProfilers)) { if (profiler->isRunning()) { stillRunning = true; break; @@ -446,21 +446,21 @@ void QQmlProfilerServiceImpl::flush() QMutexLocker lock(&m_configMutex); QList<QQmlAbstractProfilerAdapter *> reporting; - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(m_engineProfilers)) { + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(m_engineProfilers)) { if (profiler->isRunning()) { m_startTimes.insert(-1, profiler); reporting.append(profiler); } } - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(m_globalProfilers)) { + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(m_globalProfilers)) { if (profiler->isRunning()) { m_startTimes.insert(-1, profiler); reporting.append(profiler); } } - for (QQmlAbstractProfilerAdapter *profiler : qAsConst(reporting)) + for (QQmlAbstractProfilerAdapter *profiler : std::as_const(reporting)) profiler->reportData(); } diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.cpp index 8ecbfdeef8..9107715f28 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.cpp @@ -558,12 +558,12 @@ void QQmlDebugServerImpl::addEngine(QJSEngine *engine) QMutexLocker locker(&m_helloMutex); Q_ASSERT(!m_engineConditions.contains(engine)); - for (QQmlDebugService *service : qAsConst(m_plugins)) + for (QQmlDebugService *service : std::as_const(m_plugins)) service->engineAboutToBeAdded(engine); m_engineConditions[engine].waitForServices(&m_helloMutex, m_plugins.size()); - for (QQmlDebugService *service : qAsConst(m_plugins)) + for (QQmlDebugService *service : std::as_const(m_plugins)) service->engineAdded(engine); } @@ -575,12 +575,12 @@ void QQmlDebugServerImpl::removeEngine(QJSEngine *engine) QMutexLocker locker(&m_helloMutex); Q_ASSERT(m_engineConditions.contains(engine)); - for (QQmlDebugService *service : qAsConst(m_plugins)) + for (QQmlDebugService *service : std::as_const(m_plugins)) service->engineAboutToBeRemoved(engine); m_engineConditions[engine].waitForServices(&m_helloMutex, m_plugins.size()); - for (QQmlDebugService *service : qAsConst(m_plugins)) + for (QQmlDebugService *service : std::as_const(m_plugins)) service->engineRemoved(engine); m_engineConditions.remove(engine); |