aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/doc/src/tools/qtqml-tooling-qmllint.qdoc4
-rw-r--r--src/qml/doc/src/tools/qtqml-tooling-svgtoqml.qdoc6
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
-rw-r--r--src/qml/qml/qqml.cpp2
-rw-r--r--src/qml/qml/qqmlimport.cpp5
-rw-r--r--src/qml/qml/qqmlpropertycachecreator_p.h6
-rw-r--r--src/qml/qml/qqmltype_p_p.h2
-rw-r--r--src/qml/qml/qqmltypecompiler.cpp7
-rw-r--r--src/qml/qml/qqmltypedata.cpp4
9 files changed, 27 insertions, 11 deletions
diff --git a/src/qml/doc/src/tools/qtqml-tooling-qmllint.qdoc b/src/qml/doc/src/tools/qtqml-tooling-qmllint.qdoc
index 1aa59839ea..8ced3cc537 100644
--- a/src/qml/doc/src/tools/qtqml-tooling-qmllint.qdoc
+++ b/src/qml/doc/src/tools/qtqml-tooling-qmllint.qdoc
@@ -16,6 +16,10 @@ for ease of use. It also warns about some QML anti-patterns. If you want to
disable a specific warning type, you can find the appropriate flag for doing so
by passing \c{--help} on the command line.
+\note When using IDE, such as Qt Creator, you don't need to run \c qmllint
+manually. The IDE uses \l {QML Language Server#Linting}{QML Language Server},
+that provides real-time linting output and diagnostics as you type.
+
By default, some issues will result in warnings that will be printed. If there
are more warnings than a limit which can be configured with \c{--max-warnings},
the exit code will be non-zero.
diff --git a/src/qml/doc/src/tools/qtqml-tooling-svgtoqml.qdoc b/src/qml/doc/src/tools/qtqml-tooling-svgtoqml.qdoc
index e64ca28121..637a41a2f8 100644
--- a/src/qml/doc/src/tools/qtqml-tooling-svgtoqml.qdoc
+++ b/src/qml/doc/src/tools/qtqml-tooling-svgtoqml.qdoc
@@ -45,6 +45,10 @@ In addition, it supports the following options:
\li Enables the curve renderer backend for \l{Qt Quick Shapes}. This enables smooth, antialiased
shapes in the scene without multi-sampling, but at some extra cost.
\row
+ \li \c{-a}, \c{--asynchronous-shapes}
+ \li Enables the {QtQuick.Shapes::Shape::asynchronous}{asynchronous} mode on all \l{Shape}
+ elements in the generated scene. This may improve CPU utilization and responsiveness.
+\row
\li \c{-p}, \c{--optimize-paths}
\li Enables optimization of paths before committing them to the QML file, potentially making
them faster to load and render later.
@@ -53,7 +57,7 @@ In addition, it supports the following options:
\li Stroke the outline (contour) of the filled shape instead of the original path.
\row
\li \c{-t}, \c{--type-name <string>}
- \li In place of \l{Shape}, the output will use the type name <string> instead. This is
+ \li In place of \l{Shape}, the output will use the type name <string> instead. This
enables using a custom item to override the default behavior of \l{Shape} items.
\row
\li \c{-v}, \c{--view}
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 950838c11c..1f9429651e 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -3167,6 +3167,8 @@ void QObjectMethod::callInternalWithMetaTypes(
QV4::coerceAndCall(
v4, &metaMethod, argv, types, argc,
[v4, thisMeta, object](void **argv, int) {
+ if (!argv[0])
+ return;
*static_cast<QString *>(argv[0])
= QObjectWrapper::objectToString(v4, thisMeta, object.qObject());
});
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index 326b252c45..09c8033418 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -826,7 +826,7 @@ static void doRegisterTypeAndRevisions(
uniqueRevisions(&revisions, type.version, added);
AliasRegistrar aliasRegistrar(&elementNames);
- for (QTypeRevision revision : revisions) {
+ for (QTypeRevision revision : std::as_const(revisions)) {
if (revision.hasMajorVersion() && revision.majorVersion() > type.version.majorVersion())
break;
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index ee7e4eb61e..b969b31b44 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -544,7 +544,10 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt
QQmlImport::RecursionRestriction recursionRestriction,
QList<QQmlError> *errors) const
{
- QQmlType t = QQmlMetaType::qmlType(type, uri, version);
+ // QQmlMetaType assumes that without a URI, it should look for types in any module
+ // But QQmlImportInstance without a URI represents a directory import, and _must not_ find
+ // types from completely unrelated modules
+ QQmlType t = uri.isEmpty() ? QQmlType() : QQmlMetaType::qmlType(type, uri, version);
if (t.isValid()) {
if (version_return)
*version_return = version;
diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h
index 267e008466..e2c33776e4 100644
--- a/src/qml/qml/qqmlpropertycachecreator_p.h
+++ b/src/qml/qml/qqmlpropertycachecreator_p.h
@@ -184,12 +184,12 @@ public:
{
switch (reason) {
case OverrideSemantics::Status::MissingBase:
- return tr("Nothing to override. Remove override keyword");
+ return tr("Nothing to override. Remove \"override\" keyword");
case OverrideSemantics::Status::OverridingFinal:
return tr("Cannot override FINAL property");
case OverrideSemantics::Status::OverridingNonVirtual:
- return tr("Cannot override non virtual property. Add virtual to the property of the "
- "base object");
+ return tr("Cannot override non virtual property. Add \"virtual\" to the property of "
+ "the base object");
default:
return tr("unknown");
}
diff --git a/src/qml/qml/qqmltype_p_p.h b/src/qml/qml/qqmltype_p_p.h
index 60081d79b1..4cdb7d1a53 100644
--- a/src/qml/qml/qqmltype_p_p.h
+++ b/src/qml/qml/qqmltype_p_p.h
@@ -39,7 +39,7 @@ public:
{
~ProxyMetaObjects()
{
- for (const QQmlProxyMetaObject::ProxyData &metaObject : data)
+ for (const QQmlProxyMetaObject::ProxyData &metaObject : std::as_const(data))
free(metaObject.metaObject);
}
diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp
index ff2cc87ff1..bbbe805e63 100644
--- a/src/qml/qml/qqmltypecompiler.cpp
+++ b/src/qml/qml/qqmltypecompiler.cpp
@@ -387,11 +387,14 @@ bool SignalHandlerResolver::resolveSignalHandlerExpressions(
const QQmlType type = typeRef ? typeRef->type() : QQmlType();
if (type.isValid()) {
COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available in %3 %4.%5.")
- .arg(typeName).arg(originalPropertyName).arg(type.module())
+ .arg(typeName, originalPropertyName, type.module())
.arg(type.version().majorVersion())
.arg(type.version().minorVersion()));
} else {
- COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available due to component versioning.").arg(typeName).arg(originalPropertyName));
+ COMPILE_EXCEPTION(
+ binding,
+ tr("\"%1.%2\" is not available due to component versioning.")
+ .arg(typeName, originalPropertyName));
}
}
diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp
index e3947d15df..50e1fb3f4f 100644
--- a/src/qml/qml/qqmltypedata.cpp
+++ b/src/qml/qml/qqmltypedata.cpp
@@ -812,7 +812,7 @@ void QQmlTypeData::continueLoadFromIR()
{
assertTypeLoaderThread();
- for (auto const& object: m_document->objects) {
+ for (auto const& object: std::as_const(m_document->objects)) {
for (auto it = object->inlineComponentsBegin(); it != object->inlineComponentsEnd(); ++it) {
QString const nameString = m_document->stringAt(it->nameIndex);
auto importUrl = finalUrl();
@@ -1181,7 +1181,7 @@ bool QQmlTypeData::resolveType(const QString &typeName, QTypeRevision &version,
error.setDescription(QQmlTypeLoader::tr("Unreported error adding script import to import database"));
}
error.setUrl(m_importCache->baseUrl());
- error.setDescription(QQmlTypeLoader::tr("%1 %2").arg(typeName).arg(error.description()));
+ error.setDescription(QQmlTypeLoader::tr("%1 %2").arg(typeName, error.description()));
}
if (lineNumber != -1)