diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-22 13:12:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-03 15:22:12 +0100 |
commit | 789929f939a60462373beae37ab4373809095cff (patch) | |
tree | d3ee9dadb901213940ba61748f303fd34ccab424 /src/qml/jsruntime | |
parent | 8ba73c0134f162afd9aa83b731a8147728642385 (diff) |
Use QTypeRevision for all versions and revisions
In many places we carry major and minor versions or revisions that are
loosely coupled to minor versions. As the Qt minor version resets now,
we need to handle these things more systematically. In particular, we
need to add a "major" part to revisions.
QTypeRevision can express the current major/minor pairs more efficiently
and can also be used to add a major version to revisions. This change
does not change the semantics, yet, but only replaces the types.
Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit_p.h | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index fa4a1f1ce4..962b23fad6 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -817,7 +817,7 @@ QQmlRefPointer<QQmlPropertyCache> ResolvedTypeReference::createPropertyCache(QQm if (typePropertyCache) { return typePropertyCache; } else if (type.isValid()) { - typePropertyCache = QQmlEnginePrivate::get(engine)->cache(type.metaObject(), minorVersion); + typePropertyCache = QQmlEnginePrivate::get(engine)->cache(type.metaObject(), version); return typePropertyCache; } else { Q_ASSERT(compilationUnit); diff --git a/src/qml/jsruntime/qv4executablecompilationunit_p.h b/src/qml/jsruntime/qv4executablecompilationunit_p.h index 8cad18a3dc..c080978a87 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit_p.h +++ b/src/qml/jsruntime/qv4executablecompilationunit_p.h @@ -326,17 +326,15 @@ private: struct ResolvedTypeReference { ResolvedTypeReference() - : majorVersion(0) - , minorVersion(0) - , isFullyDynamicType(false) + : version(QTypeRevision::zero()) + , isFullyDynamicType(false) {} QQmlType type; QQmlRefPointer<QQmlPropertyCache> typePropertyCache; QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit; - int majorVersion; - int minorVersion; + QTypeRevision version; // Types such as QQmlPropertyMap can add properties dynamically at run-time and // therefore cannot have a property cache installed when instantiated. bool isFullyDynamicType; |