diff options
author | Liang Qi <liang.qi@qt.io> | 2019-02-22 14:26:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-02-22 14:26:13 +0100 |
commit | 3baa2d550512702dfc227aef0af3542ab189824f (patch) | |
tree | fe2967757ce6abe70f3f819cd8f5691cc384288d /src/qml/qml/qqmlpropertycache.cpp | |
parent | 16aff415a44f5f10c5ac95da72559839305c8ae5 (diff) | |
parent | 3ad752e1c16a3d37a71c5a7527c7e67cc333cdd2 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
Change-Id: If3bf1abc23a59c458be0bb862d92f2edcb16b79f
Diffstat (limited to 'src/qml/qml/qqmlpropertycache.cpp')
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index d619730e28..73bfd7bbaa 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -252,12 +252,22 @@ QQmlPropertyCache::QQmlPropertyCache() /*! Creates a new QQmlPropertyCache of \a metaObject. */ -QQmlPropertyCache::QQmlPropertyCache(const QMetaObject *metaObject) +QQmlPropertyCache::QQmlPropertyCache(const QMetaObject *metaObject, int metaObjectRevision) : QQmlPropertyCache() { Q_ASSERT(metaObject); update(metaObject); + + if (metaObjectRevision > 0) { + // Set the revision of the meta object that this cache describes to be + // 'metaObjectRevision'. This is useful when constructing a property cache + // from a type that was created directly in C++, and not through QML. For such + // types, the revision for each recorded QMetaObject would normally be zero, which + // would exclude any revisioned properties. + for (int metaObjectOffset = 0; metaObjectOffset < allowedRevisionCache.size(); ++metaObjectOffset) + allowedRevisionCache[metaObjectOffset] = metaObjectRevision; + } } QQmlPropertyCache::~QQmlPropertyCache() @@ -454,7 +464,7 @@ QQmlPropertyCache::copyAndAppend(const QMetaObject *metaObject, QQmlPropertyCache * QQmlPropertyCache::copyAndAppend(const QMetaObject *metaObject, - int revision, + int typeMinorVersion, QQmlPropertyData::Flags propertyFlags, QQmlPropertyData::Flags methodFlags, QQmlPropertyData::Flags signalFlags) @@ -468,19 +478,17 @@ QQmlPropertyCache::copyAndAppend(const QMetaObject *metaObject, QMetaObjectPrivate::get(metaObject)->signalCount + QMetaObjectPrivate::get(metaObject)->propertyCount); - rv->append(metaObject, revision, propertyFlags, methodFlags, signalFlags); + rv->append(metaObject, typeMinorVersion, propertyFlags, methodFlags, signalFlags); return rv; } void QQmlPropertyCache::append(const QMetaObject *metaObject, - int revision, + int typeMinorVersion, QQmlPropertyData::Flags propertyFlags, QQmlPropertyData::Flags methodFlags, QQmlPropertyData::Flags signalFlags) { - Q_UNUSED(revision); - _metaObject = metaObject; bool dynamicMetaObject = isDynamicMetaObject(metaObject); @@ -630,6 +638,7 @@ void QQmlPropertyCache::append(const QMetaObject *metaObject, data->setFlags(propertyFlags); data->lazyLoad(p); + data->setTypeMinorVersion(typeMinorVersion); data->_flags.isDirect = !dynamicMetaObject; |