QML_RUNTIME_TESTING should be disabled by default.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / qdeclarativepropertycache_p.h
index ef8cefd..d5d7095 100644 (file)
@@ -153,6 +153,10 @@ public:
     // Returns -1 if not a value type virtual property
     inline int getValueTypeCoreIndex() const;
 
+    // Returns the "encoded" index for use with bindings.  Encoding is:
+    //     coreIndex | (valueTypeCoreIndex << 24)
+    inline int encodedIndex() const;
+
     union {
         int propType;             // When !NotFullyResolved
         const char *propTypeName; // When NotFullyResolved
@@ -339,6 +343,11 @@ int QDeclarativePropertyRawData::getValueTypeCoreIndex() const
     return isValueTypeVirtual()?valueTypeCoreIndex:-1;
 }
 
+int QDeclarativePropertyRawData::encodedIndex() const
+{
+    return isValueTypeVirtual()?(coreIndex | (valueTypeCoreIndex << 24)):coreIndex;
+}
+
 QDeclarativePropertyData *
 QDeclarativePropertyCache::overrideData(QDeclarativePropertyData *data) const
 {
@@ -353,7 +362,7 @@ QDeclarativePropertyCache::overrideData(QDeclarativePropertyData *data) const
 
 bool QDeclarativePropertyCache::isAllowedInRevision(QDeclarativePropertyData *data) const
 {
-    return (data->hasAccessors() || data->metaObjectOffset == -1 && data->revision == 0) ||
+    return (data->hasAccessors() || (data->metaObjectOffset == -1 && data->revision == 0)) ||
            (allowedRevisionCache[data->metaObjectOffset] >= data->revision);
 }