aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljstypedescriptionreader.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-16 09:11:40 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-19 15:59:58 +0200
commitc010364342e3cd749c5ec8e44f1b73e7d8cba99c (patch)
tree55e3828d67da44460f5c9dec497d3197642744e7 /src/qmlcompiler/qqmljstypedescriptionreader.cpp
parentcc57bac899b6e13078197da7c40ad27fade7ee0d (diff)
QmlCompiler: Drop the metaobject revision from exports
Instead, output a warning if the revision doesn't match the version. We want to get rid of generic version/revision matching. To this end, add a way to retrieve the version from an export. Change-Id: Ie887103eba910f14e49faa684ac559cc72cab199 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljstypedescriptionreader.cpp')
-rw-r--r--src/qmlcompiler/qqmljstypedescriptionreader.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljstypedescriptionreader.cpp b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
index f0b011cc7e..4b7dcead31 100644
--- a/src/qmlcompiler/qqmljstypedescriptionreader.cpp
+++ b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
@@ -642,7 +642,17 @@ void QQmlJSTypeDescriptionReader::readMetaObjectRevisions(UiScriptBinding *ast,
return;
}
- scope->setExportMetaObjectRevision(exportIndex, metaObjectRevision);
+ const QTypeRevision metaObjectVersion
+ = QTypeRevision::fromEncodedVersion(metaObjectRevision);
+ const QTypeRevision exportVersion = scope->exports()[exportIndex].version();
+ if (metaObjectVersion != exportVersion) {
+ addWarning(numberLit->firstSourceLocation(),
+ tr("Meta object revision and export version differ, ignoring the revision.\n"
+ "Revision %1 corresponds to version %2.%3; it should be %4.%5.")
+ .arg(metaObjectRevision)
+ .arg(metaObjectVersion.majorVersion()).arg(metaObjectVersion.minorVersion())
+ .arg(exportVersion.majorVersion()).arg(exportVersion.minorVersion()));
+ }
}
}