diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-27 17:31:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-03-17 14:44:17 +0100 |
commit | 1eb20d70619cc896fc283bd6605b257a8750c518 (patch) | |
tree | 1d308932d38759a643d8eef49b211329a2cd5467 /src/qml/compiler | |
parent | e3c64aff6579f04353608d4b218f031d9137d3f4 (diff) |
Allow partial and absent version specifiers in import statements
An import statement without version specifier imports the latest version
available, one with only a major version imports the latest minor
version from that major version.
Task-number: QTBUG-71278
Change-Id: I43907ae4e1052be533039d545de5391c41d38307
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 5217e11115..0316e54c09 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -749,12 +749,8 @@ bool IRBuilder::visit(QQmlJS::AST::UiImport *node) if (node->version) { import->version = node->version->version; - } else if (import->type == QV4::CompiledData::Import::ImportLibrary) { - recordError(node->importIdToken, QCoreApplication::translate("QQmlParser","Library import requires a version")); - return false; } else { - // For backward compatibility in how the imports are loaded we - // must otherwise initialize the major and minor version to invalid. + // Otherwise initialize the major and minor version to invalid to signal "latest". import->version = QTypeRevision(); } |