/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
bool isSignalHandler() const { return flags & IsSignalHandler; }
bool isOverload() const { return flags & IsOverload; }
- bool hasOverride() const { return !(flags & IsValueTypeVirtual) && overrideIndex >= 0; }
+ bool hasOverride() const { return !(flags & IsValueTypeVirtual) &&
+ !(flags & HasAccessors) &&
+ overrideIndex >= 0; }
// 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
int notifyIndex; // When !IsFunction
void *arguments; // When IsFunction && HasArguments
};
+
union {
- struct { // When !IsValueTypeVirtual
- uint overrideIndexIsProperty : 1;
- signed int overrideIndex : 31;
+ struct { // When !HasAccessors
+ qint16 revision;
+ qint16 metaObjectOffset;
+
+ union {
+ struct { // When IsValueTypeVirtual
+ quint16 valueTypeFlags; // flags of the access property on the value type proxy
+ // object
+ quint8 valueTypePropType; // The QVariant::Type of access property on the value
+ // type proxy object
+ quint8 valueTypeCoreIndex; // The prop index of the access property on the value
+ // type proxy object
+ };
+
+ struct { // When !IsValueTypeVirtual
+ uint overrideIndexIsProperty : 1;
+ signed int overrideIndex : 31;
+ };
+ };
};
- struct { // When IsValueTypeVirtual
- quint16 valueTypeFlags; // flags of the access property on the value type proxy object
- quint8 valueTypePropType; // The QVariant::Type of access property on the value type
- // proxy object
- quint8 valueTypeCoreIndex; // The prop index of the access property on the value type
- //proxy object
+ struct { // When HasAccessors
+ QDeclarativeAccessors *accessors;
+ intptr_t accessorData;
};
};
- qint16 revision;
- qint16 metaObjectOffset;
-
- struct { // When HasAccessors
- QDeclarativeAccessors *accessors;
- intptr_t accessorData;
- };
-
private:
friend class QDeclarativePropertyData;
friend class QDeclarativePropertyCache;
void update(QDeclarativeEngine *, const QMetaObject *);
- QDeclarativePropertyCache *copy(int reserve = 0);
+ QDeclarativePropertyCache *copy();
+
+ QDeclarativePropertyCache *copyAndAppend(QDeclarativeEngine *, const QMetaObject *,
+ QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags,
+ QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags,
+ QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags);
+ QDeclarativePropertyCache *copyAndAppend(QDeclarativeEngine *, const QMetaObject *, int revision,
+ QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags,
+ QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags,
+ QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags);
+
void append(QDeclarativeEngine *, const QMetaObject *,
QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags,
QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags,
friend class QDeclarativeEnginePrivate;
friend class QV8QObjectWrapper;
+ inline QDeclarativePropertyCache *copy(int reserve);
+
// Implemented in v8/qv8qobjectwrapper.cpp
v8::Local<v8::Object> newQObject(QObject *, QV8Engine *);
QDeclarativePropertyCache *parent;
int propertyIndexCacheStart;
int methodIndexCacheStart;
+ int signalHanderIndexCacheStart;
IndexCache propertyIndexCache;
IndexCache methodIndexCache;
overrideIndex = -1;
revision = 0;
metaObjectOffset = -1;
- accessors = 0;
- accessorData = 0;
flags = 0;
}
return isValueTypeVirtual()?valueTypeCoreIndex:-1;
}
+int QDeclarativePropertyRawData::encodedIndex() const
+{
+ return isValueTypeVirtual()?(coreIndex | (valueTypeCoreIndex << 24)):coreIndex;
+}
+
QDeclarativePropertyData *
QDeclarativePropertyCache::overrideData(QDeclarativePropertyData *data) const
{
bool QDeclarativePropertyCache::isAllowedInRevision(QDeclarativePropertyData *data) const
{
- return (data->metaObjectOffset == -1 && data->revision == 0) ||
+ return (data->hasAccessors() || (data->metaObjectOffset == -1 && data->revision == 0)) ||
(allowedRevisionCache[data->metaObjectOffset] >= data->revision);
}