diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-07-22 10:08:17 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-04 12:11:05 +0000 |
commit | 1534dd6d97c49f5c7e0392df9c95198311b5b817 (patch) | |
tree | dad42c0c12c0ef3005b26645df6cc21832f54315 /src/qml/qml/qqmldata_p.h | |
parent | fdc3dcd43f8944eb33e778627c43ab9487a26960 (diff) |
QML: Introduce QQmlPropertyIndex
This helps in making it clear when an index is a plain old number and
when it consists of an encoded value type index.
Change-Id: Ic50d95caf244ed0ee2d62bdba53910a371cfee04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmldata_p.h')
-rw-r--r-- | src/qml/qml/qqmldata_p.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h index a9f2acdb06..d9a69a9ca3 100644 --- a/src/qml/qml/qqmldata_p.h +++ b/src/qml/qml/qqmldata_p.h @@ -53,7 +53,7 @@ #include <private/qtqmlglobal_p.h> #include <private/qobject_p.h> - +#include <private/qqmlpropertyindex_p.h> #include <private/qv4value_p.h> #include <private/qv4persistent_p.h> #include <qjsengine.h> @@ -174,7 +174,7 @@ public: void clearBindingBit(int); void setBindingBit(QObject *obj, int); - inline bool hasPendingBindingBit(int) const; + inline bool hasPendingBindingBit(int index) const; void setPendingBindingBit(QObject *obj, int); void clearPendingBindingBit(int); @@ -227,7 +227,7 @@ public: static void markAsDeleted(QObject *); static void setQueuedForDeletion(QObject *); - static inline void flushPendingBinding(QObject *, int coreIndex); + static inline void flushPendingBinding(QObject *, QQmlPropertyIndex propertyIndex); static QQmlPropertyCache *ensurePropertyCache(QJSEngine *engine, QObject *object); @@ -235,7 +235,7 @@ private: // For attachedProperties mutable QQmlDataExtended *extendedData; - void flushPendingBindingImpl(int coreIndex); + void flushPendingBindingImpl(QQmlPropertyIndex index); }; bool QQmlData::wasDeleted(QObject *object) @@ -288,20 +288,20 @@ bool QQmlData::hasBindingBit(int coreIndex) const (bindingBits[bit / 32] & (1 << (bit % 32)))); } -bool QQmlData::hasPendingBindingBit(int coreIndex) const +bool QQmlData::hasPendingBindingBit(int index) const { - int bit = coreIndex * 2 + 1; + int bit = index * 2 + 1; return bindingBitsSize > bit && ((bindingBitsSize == 32) ? (bindingBitsValue & (1 << bit)) : (bindingBits[bit / 32] & (1 << (bit % 32)))); } -void QQmlData::flushPendingBinding(QObject *o, int coreIndex) +void QQmlData::flushPendingBinding(QObject *o, QQmlPropertyIndex propertyIndex) { QQmlData *data = QQmlData::get(o, false); - if (data && data->hasPendingBindingBit(coreIndex)) - data->flushPendingBindingImpl(coreIndex); + if (data && data->hasPendingBindingBit(propertyIndex.coreIndex())) + data->flushPendingBindingImpl(propertyIndex); } QT_END_NAMESPACE |