diff options
Diffstat (limited to 'src/qml')
27 files changed, 64 insertions, 64 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 6224d033fe..7bb2af476c 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -48,11 +48,11 @@ void QQmlAnimationTimer::unsetJobTimer(QAbstractAnimationJob *animation) QQmlAnimationTimer::~QQmlAnimationTimer() { - for (const auto &animation : qAsConst(animations)) + for (const auto &animation : std::as_const(animations)) unsetJobTimer(animation); - for (const auto &animation : qAsConst(animationsToStart)) + for (const auto &animation : std::as_const(animationsToStart)) unsetJobTimer(animation); - for (const auto &animation : qAsConst(runningPauseAnimations)) + for (const auto &animation : std::as_const(runningPauseAnimations)) unsetJobTimer(animation); } diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 5beeda930f..92b1d897e3 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1391,7 +1391,7 @@ bool IRBuilder::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, O // If it's a namespace, prepend the qualifier and we'll resolve it later to the correct type. QString currentName = qualifiedIdElement->name.toString(); if (qualifiedIdElement->next) { - for (const QV4::CompiledData::Import* import : qAsConst(_imports)) + for (const QV4::CompiledData::Import* import : std::as_const(_imports)) if (import->qualifierIndex != emptyStringIndex && stringAt(import->qualifierIndex) == currentName) { qualifiedIdElement = qualifiedIdElement->next; @@ -1522,7 +1522,7 @@ void QmlUnitGenerator::generate(Document &output, const QV4::CompiledData::Depen jsUnit = createdUnit = output.jsGenerator.generateUnit(); // enable flag if we encountered pragma Singleton - for (Pragma *p : qAsConst(output.pragmas)) { + for (Pragma *p : std::as_const(output.pragmas)) { switch (p->type) { case Pragma::Singleton: createdUnit->flags |= Unit::IsSingleton; @@ -1579,7 +1579,7 @@ void QmlUnitGenerator::generate(Document &output, const QV4::CompiledData::Depen const unsigned int objectOffset = sizeof(QV4::CompiledData::QmlUnit) + importSize; uint nextOffset = objectOffset + objectOffsetTableSize; - for (Object *o : qAsConst(output.objects)) { + for (Object *o : std::as_const(output.objects)) { objectOffsets.insert(o, nextOffset); nextOffset += QV4::CompiledData::Object::calculateSizeExcludingSignalsAndEnums(o->functionCount(), o->propertyCount(), o->aliasCount(), o->enumCount(), o->signalCount(), o->bindingCount(), o->namedObjectsInComponent.size(), o->inlineComponentCount(), o->requiredPropertyExtraDataCount()); @@ -1607,7 +1607,7 @@ void QmlUnitGenerator::generate(Document &output, const QV4::CompiledData::Depen // write imports char *importPtr = data + qmlUnit->offsetToImports; - for (const QV4::CompiledData::Import *imp : qAsConst(output.imports)) { + for (const QV4::CompiledData::Import *imp : std::as_const(output.imports)) { QV4::CompiledData::Import *importToWrite = reinterpret_cast<QV4::CompiledData::Import*>(importPtr); *importToWrite = *imp; importPtr += sizeof(QV4::CompiledData::Import); diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 3d8594214b..bab1f026c3 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -209,7 +209,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO { registerString(module->fileName); registerString(module->finalUrl); - for (Context *f : qAsConst(module->functions)) { + for (Context *f : std::as_const(module->functions)) { registerString(f->name); registerString(f->returnType); for (int i = 0; i < f->arguments.size(); ++i) { @@ -219,7 +219,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO for (int i = 0; i < f->locals.size(); ++i) registerString(f->locals.at(i)); } - for (Context *c : qAsConst(module->blocks)) { + for (Context *c : std::as_const(module->blocks)) { for (int i = 0; i < c->locals.size(); ++i) registerString(c->locals.at(i)); } @@ -290,7 +290,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO } CompiledData::Lookup *lookupsToWrite = reinterpret_cast<CompiledData::Lookup*>(dataPtr + unit->offsetToLookupTable); - for (const CompiledData::Lookup &l : qAsConst(lookups)) + for (const CompiledData::Lookup &l : std::as_const(lookups)) *lookupsToWrite++ = l; CompiledData::RegExp *regexpTable = reinterpret_cast<CompiledData::RegExp *>(dataPtr + unit->offsetToRegexpTable); diff --git a/src/qml/compiler/qv4compilercontext.cpp b/src/qml/compiler/qv4compilercontext.cpp index 696bffa23b..1d4b0bde17 100644 --- a/src/qml/compiler/qv4compilercontext.cpp +++ b/src/qml/compiler/qv4compilercontext.cpp @@ -272,7 +272,7 @@ void Context::emitBlockHeader(Codegen *codegen) codegen->referenceForName(QStringLiteral("arguments"), false).storeConsumeAccumulator(); } - for (const Context::Member &member : qAsConst(members)) { + for (const Context::Member &member : std::as_const(members)) { if (member.function) { const int function = codegen->defineFunction(member.function->name.toString(), member.function, member.function->formals, member.function->body); codegen->loadClosure(function); @@ -361,7 +361,7 @@ void Context::setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator) } sizeOfLocalTemporalDeadZone = localsInTDZ.size(); - for (auto &member: qAsConst(localsInTDZ)) { + for (auto &member: std::as_const(localsInTDZ)) { member->index = locals.size(); locals.append(member.key()); } @@ -377,7 +377,7 @@ void Context::setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator) sizeOfRegisterTemporalDeadZone = registersInTDZ.size(); firstTemporalDeadZoneRegister = bytecodeGenerator->currentRegister(); - for (auto &member: qAsConst(registersInTDZ)) + for (auto &member: std::as_const(registersInTDZ)) member->index = bytecodeGenerator->newRegister(); nRegisters = bytecodeGenerator->currentRegister() - registerOffset; diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index ee54137c10..157d2896aa 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -308,7 +308,7 @@ bool ScanFunctions::visit(PatternElement *ast) declarationLocation.length = ast->lastSourceLocation().end() - declarationLocation.offset; } - for (const auto &name : qAsConst(names)) { + for (const auto &name : std::as_const(names)) { if (_context->isStrict && (name.id == QLatin1String("eval") || name.id == QLatin1String("arguments"))) _cg->throwSyntaxError(ast->identifierToken, QStringLiteral("Variable name may not be eval or arguments in strict mode")); checkName(QStringView(name.id), ast->identifierToken); @@ -721,7 +721,7 @@ void ScanFunctions::calcEscapingVariables() { Module *m = _cg->_module; - for (Context *inner : qAsConst(m->contextMap)) { + for (Context *inner : std::as_const(m->contextMap)) { if (inner->usesArgumentsObject != Context::ArgumentsObjectUsed) continue; if (inner->contextType != ContextType::Block && !inner->isArrowFunction) @@ -733,7 +733,7 @@ void ScanFunctions::calcEscapingVariables() c->usesArgumentsObject = Context::ArgumentsObjectUsed; inner->usesArgumentsObject = Context::ArgumentsObjectNotUsed; } - for (Context *inner : qAsConst(m->contextMap)) { + for (Context *inner : std::as_const(m->contextMap)) { if (!inner->parent || inner->usesArgumentsObject == Context::ArgumentsObjectUnknown) inner->usesArgumentsObject = Context::ArgumentsObjectNotUsed; if (inner->usesArgumentsObject == Context::ArgumentsObjectUsed) { @@ -746,7 +746,7 @@ void ScanFunctions::calcEscapingVariables() } } - for (Context *c : qAsConst(m->contextMap)) { + for (Context *c : std::as_const(m->contextMap)) { if (c->contextType != ContextType::ESModule) continue; for (const auto &entry: c->exportEntries) { @@ -757,8 +757,8 @@ void ScanFunctions::calcEscapingVariables() break; } - for (Context *inner : qAsConst(m->contextMap)) { - for (const QString &var : qAsConst(inner->usedVariables)) { + for (Context *inner : std::as_const(m->contextMap)) { + for (const QString &var : std::as_const(inner->usedVariables)) { Context *c = inner; while (c) { Context *current = c; @@ -820,7 +820,7 @@ void ScanFunctions::calcEscapingVariables() c->innerFunctionAccessesThis |= innerFunctionAccessesThis; } } - for (Context *c : qAsConst(m->contextMap)) { + for (Context *c : std::as_const(m->contextMap)) { if (c->innerFunctionAccessesThis) { // add an escaping 'this' variable c->addLocalVar(QStringLiteral("this"), Context::VariableDefinition, VariableScope::Let); @@ -846,7 +846,7 @@ void ScanFunctions::calcEscapingVariables() c->requiresExecutionContext = true; c->argumentsCanEscape = true; } else { - for (const auto &m : qAsConst(c->members)) { + for (const auto &m : std::as_const(c->members)) { if (m.isLexicallyScoped()) { c->requiresExecutionContext = true; break; @@ -867,7 +867,7 @@ void ScanFunctions::calcEscapingVariables() // we don't know if the code is a signal handler or not. c->requiresExecutionContext = true; if (c->allVarsEscape) { - for (const auto &m : qAsConst(c->members)) + for (const auto &m : std::as_const(c->members)) m.canEscape = true; } } @@ -875,7 +875,7 @@ void ScanFunctions::calcEscapingVariables() static const bool showEscapingVars = qEnvironmentVariableIsSet("QV4_SHOW_ESCAPING_VARS"); if (showEscapingVars) { qDebug() << "==== escaping variables ===="; - for (Context *c : qAsConst(m->contextMap)) { + for (Context *c : std::as_const(m->contextMap)) { qDebug() << "Context" << c << c->name << "requiresExecutionContext" << c->requiresExecutionContext << "isStrict" << c->isStrict; qDebug() << " isArrowFunction" << c->isArrowFunction << "innerFunctionAccessesThis" << c->innerFunctionAccessesThis; qDebug() << " parent:" << c->parent; diff --git a/src/qml/debugger/qqmlconfigurabledebugservice_p.h b/src/qml/debugger/qqmlconfigurabledebugservice_p.h index 8451f4e800..ce911c5baf 100644 --- a/src/qml/debugger/qqmlconfigurabledebugservice_p.h +++ b/src/qml/debugger/qqmlconfigurabledebugservice_p.h @@ -37,7 +37,7 @@ protected: { QMutexLocker lock(&m_configMutex); m_waitingForConfiguration = false; - for (QJSEngine *engine : qAsConst(m_waitingEngines)) + for (QJSEngine *engine : std::as_const(m_waitingEngines)) Q_EMIT Base::attachedToEngine(engine); m_waitingEngines.clear(); } diff --git a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp index c933adfcaf..f82b9f6d39 100644 --- a/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp +++ b/src/qml/doc/snippets/qmltc/tst_qmltc_examples.cpp @@ -162,7 +162,7 @@ void tst_qmltc_examples::helloWorld() QVERIFY(!documentationCode.isEmpty()); auto begin = generatedCode.cbegin(); - for (const QString &existingString : qAsConst(documentationCode)) { + for (const QString &existingString : std::as_const(documentationCode)) { auto pos = std::find(begin, generatedCode.cend(), existingString); QVERIFY2(pos != generatedCode.cend(), qPrintable(u"Could not find: " + existingString)); begin = std::next(pos); diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp index f8b005e914..5a63230858 100644 --- a/src/qml/jsruntime/qv4executableallocator.cpp +++ b/src/qml/jsruntime/qv4executableallocator.cpp @@ -125,7 +125,7 @@ ExecutableAllocator::ExecutableAllocator() ExecutableAllocator::~ExecutableAllocator() { - for (ChunkOfPages *chunk : qAsConst(chunks)) { + for (ChunkOfPages *chunk : std::as_const(chunks)) { for (Allocation *allocation = chunk->firstAllocation; allocation; allocation = allocation->next) if (!allocation->free) allocation->invalidate(); diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index c0e6a71980..744a463648 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -297,7 +297,7 @@ void ExecutableCompilationUnit::unlink() delete [] runtimeLookups; runtimeLookups = nullptr; - for (QV4::Function *f : qAsConst(runtimeFunctions)) + for (QV4::Function *f : std::as_const(runtimeFunctions)) f->destroy(); runtimeFunctions.clear(); @@ -325,14 +325,14 @@ void ExecutableCompilationUnit::markObjects(QV4::MarkStack *markStack) if (runtimeClasses[i]) runtimeClasses[i]->mark(markStack); } - for (QV4::Function *f : qAsConst(runtimeFunctions)) + for (QV4::Function *f : std::as_const(runtimeFunctions)) if (f && f->internalClass) f->internalClass->mark(markStack); - for (QV4::Heap::InternalClass *c : qAsConst(runtimeBlocks)) + for (QV4::Heap::InternalClass *c : std::as_const(runtimeBlocks)) if (c) c->mark(markStack); - for (QV4::Heap::Object *o : qAsConst(templateObjects)) + for (QV4::Heap::Object *o : std::as_const(templateObjects)) if (o) o->mark(markStack); diff --git a/src/qml/jsruntime/qv4identifiertable.cpp b/src/qml/jsruntime/qv4identifiertable.cpp index e3cde9b7c7..96aa54018b 100644 --- a/src/qml/jsruntime/qv4identifiertable.cpp +++ b/src/qml/jsruntime/qv4identifiertable.cpp @@ -25,7 +25,7 @@ IdentifierTable::~IdentifierTable() { free(entriesByHash); free(entriesById); - for (const auto &h : qAsConst(idHashes)) + for (const auto &h : std::as_const(idHashes)) h->identifierTable = nullptr; } diff --git a/src/qml/jsruntime/qv4profiling.cpp b/src/qml/jsruntime/qv4profiling.cpp index 19da26989f..db33cd27f9 100644 --- a/src/qml/jsruntime/qv4profiling.cpp +++ b/src/qml/jsruntime/qv4profiling.cpp @@ -60,7 +60,7 @@ void Profiler::reportData() FunctionLocationHash locations; properties.reserve(m_data.size()); - for (const FunctionCall &call : qAsConst(m_data)) { + for (const FunctionCall &call : std::as_const(m_data)) { properties.append(call.properties()); Function *function = call.function(); SentMarker &marker = m_sentLocations[reinterpret_cast<quintptr>(function)]; diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 768482267c..f4dfc7850a 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -144,7 +144,7 @@ struct RuntimeCounters::Data { } std::sort(lines.begin(), lines.end(), Line::less); outs << lines.size() << " counters:" << endl; - for (const Line &line : qAsConst(lines)) + for (const Line &line : std::as_const(lines)) outs << qSetFieldWidth(10) << line.count << qSetFieldWidth(0) << " | " << line.func << " | " << pretty(line.tag1) diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index 72a287c318..07a8f1e278 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -581,7 +581,7 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data) auto revisions = prepareRevisions(type.instanceMetaObject, added) + furtherRevisions; uniqueRevisions(&revisions, type.version, added); - for (QTypeRevision revision : qAsConst(revisions)) { + for (QTypeRevision revision : std::as_const(revisions)) { if (revision.hasMajorVersion() && revision.majorVersion() > type.version.majorVersion()) break; @@ -624,7 +624,7 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data) revisions.append(added); uniqueRevisions(&revisions, type.version, added); - for (QTypeRevision revision : qAsConst(revisions)) { + for (QTypeRevision revision : std::as_const(revisions)) { if (revision < added) continue; if (revision.hasMajorVersion() && revision.majorVersion() > type.version.majorVersion()) diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index df8c64dab0..0a93e3b73e 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -26,7 +26,7 @@ QQmlApplicationEnginePrivate::~QQmlApplicationEnginePrivate() void QQmlApplicationEnginePrivate::cleanUp() { Q_Q(QQmlApplicationEngine); - for (auto obj : qAsConst(objects)) + for (auto obj : std::as_const(objects)) obj->disconnect(q); qDeleteAll(objects); diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 2cc7cc4d37..46def51001 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -408,7 +408,7 @@ QQmlComponent::~QQmlComponent() if (isError()) { qWarning() << "This may have been caused by one of the following errors:"; - for (const QQmlError &error : qAsConst(d->state.errors)) + for (const QQmlError &error : std::as_const(d->state.errors)) qWarning().nospace().noquote() << QLatin1String(" ") << error; } @@ -924,7 +924,7 @@ QObject *QQmlComponentPrivate::beginCreate(QQmlRefPointer<QQmlContextData> conte Q_Q(QQmlComponent); auto cleanup = qScopeGuard([this] { if (!state.errors.isEmpty() && lcQmlComponentGeneral().isDebugEnabled()) { - for (const auto &e : qAsConst(state.errors)) { + for (const auto &e : std::as_const(state.errors)) { qCDebug(lcQmlComponentGeneral) << "QQmlComponent: " << e.toString(); } } @@ -996,7 +996,7 @@ void QQmlComponentPrivate::beginDeferred(QQmlEnginePrivate *enginePriv, deferredState->reserve(ddata->deferredData.size()); - for (QQmlData::DeferredData *deferredData : qAsConst(ddata->deferredData)) { + for (QQmlData::DeferredData *deferredData : std::as_const(ddata->deferredData)) { enginePriv->inProgressCreations++; ConstructionState state; @@ -1586,7 +1586,7 @@ QObject *QQmlComponent::createObject(QObject *parent, const QVariantMap &propert if (!d->requiredProperties().empty()) { QList<QQmlError> errors; - for (const auto &requiredProperty: qAsConst(d->requiredProperties())) { + for (const auto &requiredProperty: std::as_const(d->requiredProperties())) { errors.push_back(QQmlComponentPrivate::unsetRequiredPropertyToQQmlError( requiredProperty)); } diff --git a/src/qml/qml/qqmldatablob.cpp b/src/qml/qml/qqmldatablob.cpp index 0cb685ac7f..a8a4537844 100644 --- a/src/qml/qml/qqmldatablob.cpp +++ b/src/qml/qml/qqmldatablob.cpp @@ -313,7 +313,7 @@ void QQmlDataBlob::addDependency(QQmlDataBlob *blob) status() == Error || status() == Complete || m_isDone) return; - for (const auto &existingDep: qAsConst(m_waitingFor)) + for (const auto &existingDep: std::as_const(m_waitingFor)) if (existingDep.data() == blob) return; diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 37cc6bd2c6..75cc0fb8ce 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1010,7 +1010,7 @@ QString QQmlImports::resolvedUri(const QString &dir_arg, QQmlImportDatabase *dat std::sort(paths.begin(), paths.end(), std::greater<QString>()); // Ensure subdirs preceed their parents. QString stableRelativePath = dir; - for (const QString &path : qAsConst(paths)) { + for (const QString &path : std::as_const(paths)) { if (dir.startsWith(path)) { stableRelativePath = dir.mid(path.size()+1); break; diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index af2326abc4..4c1455b2e2 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -118,7 +118,7 @@ private: for (qsizetype i = 0; i < length; ++i) stash.append(i == idx ? v : list->at(list, i)); list->clear(list); - for (T *item : qAsConst(stash)) + for (T *item : std::as_const(stash)) list->append(list, item); } else { stash.reserve(length - idx - 1); @@ -149,7 +149,7 @@ private: for (qsizetype i = 0; i < length; ++i) stash.append(list->at(list, i)); list->clear(list); - for (T *item : qAsConst(stash)) + for (T *item : std::as_const(stash)) list->append(list, item); } }; diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index f6adbd30a2..9245a03cc6 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -834,7 +834,7 @@ QQmlMetaType::RegistrationResult QQmlMetaType::registerPluginTypes( if (!failures.isEmpty()) { if (errors) { - for (const QString &failure : qAsConst(failures)) { + for (const QString &failure : std::as_const(failures)) { QQmlError error; error.setDescription(failure); errors->prepend(error); @@ -1406,7 +1406,7 @@ void QQmlMetaType::registerMetaObjectForType(const QMetaObject *metaobject, QQml static bool hasActiveInlineComponents(const QQmlTypePrivate *d) { - for (const QQmlType &ic : qAsConst(d->objectIdToICType)) { + for (const QQmlType &ic : std::as_const(d->objectIdToICType)) { const QQmlTypePrivate *icPriv = ic.priv(); if (icPriv && icPriv->count() > 1) return true; @@ -1513,7 +1513,7 @@ QList<QQmlType> QQmlMetaType::qmlSingletonTypes() const QQmlMetaTypeDataPtr data; QList<QQmlType> retn; - for (const auto t : qAsConst(data->nameToType)) { + for (const auto t : std::as_const(data->nameToType)) { QQmlType type(t); if (type.isSingleton()) retn.append(type); @@ -1525,7 +1525,7 @@ const QQmlPrivate::CachedQmlUnit *QQmlMetaType::findCachedCompilationUnit(const { const QQmlMetaTypeDataPtr data; - for (const auto lookup : qAsConst(data->lookupCachedQmlUnit)) { + for (const auto lookup : std::as_const(data->lookupCachedQmlUnit)) { if (const QQmlPrivate::CachedQmlUnit *unit = lookup(uri)) { QString error; if (!QV4::ExecutableCompilationUnit::verifyHeader(unit->qmlData, QDateTime(), &error)) { diff --git a/src/qml/qml/qqmlopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp index b9934eb76a..cf51286677 100644 --- a/src/qml/qml/qqmlopenmetaobject.cpp +++ b/src/qml/qml/qqmlopenmetaobject.cpp @@ -375,7 +375,7 @@ void QQmlOpenMetaObject::setValues(const QHash<QByteArray, QVariant> &values, bo d->type->createProperties(missingProperties); d->dropPropertyCache(); - for (const QByteArray &name : qAsConst(missingProperties)) + for (const QByteArray &name : std::as_const(missingProperties)) checkedSetValue(names[name], values[name], force); } diff --git a/src/qml/qml/qqmlpluginimporter.cpp b/src/qml/qml/qqmlpluginimporter.cpp index a29a3101ec..0b14d1f561 100644 --- a/src/qml/qml/qqmlpluginimporter.cpp +++ b/src/qml/qml/qqmlpluginimporter.cpp @@ -129,7 +129,7 @@ static bool unloadPlugin(const std::pair<const QString, QmlPlugin> &plugin) void qmlClearEnginePlugins() { PluginMapPtr plugins(qmlPluginsById()); - for (const auto &plugin : qAsConst(*plugins)) + for (const auto &plugin : std::as_const(*plugins)) unloadPlugin(plugin); plugins->clear(); } @@ -395,7 +395,7 @@ QString QQmlPluginImporter::resolvePlugin(const QString &qmldirPluginPath, const if (!qmldirPluginPathIsRelative) searchPaths.prepend(qmldirPluginPath); - for (const QString &pluginPath : qAsConst(searchPaths)) { + for (const QString &pluginPath : std::as_const(searchPaths)) { QString resolvedBasePath; if (pluginPath == QLatin1String(".")) { if (qmldirPluginPathIsRelative && !qmldirPluginPath.isEmpty() @@ -550,7 +550,7 @@ QTypeRevision QQmlPluginImporter::importPlugins() { return QTypeRevision(); for (const QString &versionUri : versionUris) { - for (const StaticPluginData &pair : qAsConst(pluginPairs)) { + for (const StaticPluginData &pair : std::as_const(pluginPairs)) { for (const QJsonValueConstRef metaTagUri : pair.uriList) { if (versionUri == metaTagUri.toString()) { staticPluginsFound++; diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h index 42345448a6..1901688174 100644 --- a/src/qml/qml/qqmlpropertycachecreator_p.h +++ b/src/qml/qml/qqmlpropertycachecreator_p.h @@ -830,7 +830,7 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasPropertie do { QVector<int> pendingObjects; - for (int objectIndex: qAsConst(objectsWithAliases)) { + for (int objectIndex: std::as_const(objectsWithAliases)) { const CompiledObject &object = *objectContainer->objectAt(objectIndex); if (allAliasTargetsExist(object)) { diff --git a/src/qml/qml/qqmltype.cpp b/src/qml/qml/qqmltype.cpp index c6f948e355..52437348d9 100644 --- a/src/qml/qml/qqmltype.cpp +++ b/src/qml/qml/qqmltype.cpp @@ -371,7 +371,7 @@ void QQmlTypePrivate::createEnumConflictReport(const QMetaObject *metaObject, co qWarning().noquote() << QLatin1String("Possible conflicting items:"); // find items with conflicting key - for (const auto &i : qAsConst(enumInfoList)) { + for (const auto &i : std::as_const(enumInfoList)) { if (i.enumKey == conflictingKey) qWarning().noquote().nospace() << " " << i.metaObjectName << "." << i.enumName << "." << i.enumKey << " from scope " << i.metaEnumScope << " injected by " << i.path.join(QLatin1String("->")); diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp index f2fddae3f7..c2aff473fd 100644 --- a/src/qml/qml/qqmltypecompiler.cpp +++ b/src/qml/qml/qqmltypecompiler.cpp @@ -117,7 +117,7 @@ QQmlRefPointer<QV4::ExecutableCompilationUnit> QQmlTypeCompiler::compile() document->jsModule.fileName = typeData->urlString(); document->jsModule.finalUrl = typeData->finalUrlString(); QmlIR::JSCodeGen v4CodeGenerator(document, engine->v4engine()->illegalNames()); - for (QmlIR::Object *object : qAsConst(document->objects)) { + for (QmlIR::Object *object : std::as_const(document->objects)) { if (!v4CodeGenerator.generateRuntimeFunctions(object)) { Q_ASSERT(v4CodeGenerator.hasError()); recordError(v4CodeGenerator.error()); @@ -1016,7 +1016,7 @@ bool QQmlComponentAndAliasResolver::resolveAliases(int componentIndex) atLeastOneAliasResolved = false; QVector<int> pendingObjects; - for (int objectIndex: qAsConst(_objectsWithAliases)) { + for (int objectIndex: std::as_const(_objectsWithAliases)) { QQmlError error; const auto result = resolveAliasesInObject(objectIndex, &error); diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp index 899192adbd..c56acaef0d 100644 --- a/src/qml/qml/qqmltypedata.cpp +++ b/src/qml/qml/qqmltypedata.cpp @@ -309,7 +309,7 @@ void QQmlTypeData::done() } // Check all type dependencies for errors - for (auto it = qAsConst(m_resolvedTypes).begin(), end = qAsConst(m_resolvedTypes).end(); it != end; + for (auto it = std::as_const(m_resolvedTypes).begin(), end = std::as_const(m_resolvedTypes).end(); it != end; ++it) { const TypeReference &type = *it; Q_ASSERT(!type.typeData || type.typeData->isCompleteOrError() || type.type.isInlineComponentType()); @@ -470,7 +470,7 @@ void QQmlTypeData::done() auto type = QQmlMetaType::typeForUrl(finalUrlString(), hashedStringRef, false, &errors); Q_ASSERT(errors.empty()); if (type.isValid()) { - for (auto const &icDatum : qAsConst(m_inlineComponentData)) { + for (auto const &icDatum : std::as_const(m_inlineComponentData)) { Q_ASSERT(icDatum.typeIds.isValid()); QQmlType existingType = type.lookupInlineComponentById(type.lookupInlineComponentIdByName(m_compiledData->stringAt(icDatum.nameIndex))); type.associateInlineComponent(m_compiledData->stringAt(icDatum.nameIndex), @@ -600,7 +600,7 @@ bool QQmlTypeData::loadFromSource() if (!compiler.generateFromQml(source, finalUrlString(), m_document.data())) { QList<QQmlError> errors; errors.reserve(compiler.errors.size()); - for (const QQmlJS::DiagnosticMessage &msg : qAsConst(compiler.errors)) { + for (const QQmlJS::DiagnosticMessage &msg : std::as_const(compiler.errors)) { QQmlError e; e.setUrl(url()); e.setLine(qmlConvertSourceCoordinate<quint32, int>(msg.loc.startLine)); @@ -668,7 +668,7 @@ void QQmlTypeData::continueLoadFromIR() QList<QQmlError> errors; - for (const QV4::CompiledData::Import *import : qAsConst(m_document->imports)) { + for (const QV4::CompiledData::Import *import : std::as_const(m_document->imports)) { if (!addImport(import, {}, &errors)) { Q_ASSERT(errors.size()); diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 60403c1bad..f4677b6848 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1436,7 +1436,7 @@ void QQmlXMLHttpRequest::finished() void QQmlXMLHttpRequest::readEncoding() { - for (const HeaderPair &header : qAsConst(m_headersList)) { + for (const HeaderPair &header : std::as_const(m_headersList)) { if (header.first == "content-type") { int separatorIdx = header.second.indexOf(';'); if (separatorIdx == -1) { diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp index cb1148a416..e10327e240 100644 --- a/src/qml/types/qqmlconnections.cpp +++ b/src/qml/types/qqmlconnections.cpp @@ -138,7 +138,7 @@ void QQmlConnections::setTarget(QObject *obj) if (d->targetSet && d->target == obj) return; d->targetSet = true; // even if setting to 0, it is *set* - for (QQmlBoundSignal *s : qAsConst(d->boundsignals)) { + for (QQmlBoundSignal *s : std::as_const(d->boundsignals)) { // It is possible that target is being changed due to one of our signal // handlers -> use deleteLater(). if (s->isNotifying()) @@ -174,7 +174,7 @@ void QQmlConnections::setEnabled(bool enabled) d->enabled = enabled; - for (QQmlBoundSignal *s : qAsConst(d->boundsignals)) + for (QQmlBoundSignal *s : std::as_const(d->boundsignals)) s->setEnabled(d->enabled); emit enabledChanged(); @@ -321,7 +321,7 @@ void QQmlConnections::connectSignalsToBindings() QQmlData *ddata = QQmlData::get(this); QQmlRefPointer<QQmlContextData> ctxtdata = ddata ? ddata->outerContext : nullptr; - for (const QV4::CompiledData::Binding *binding : qAsConst(d->bindings)) { + for (const QV4::CompiledData::Binding *binding : std::as_const(d->bindings)) { Q_ASSERT(binding->type() == QV4::CompiledData::Binding::Type_Script); QString propName = d->compilationUnit->stringAt(binding->propertyNameIndex); |