aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qv8bindings_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-03-09 12:29:51 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-30 12:55:35 +0200
commitc1751ca39a21ee29fa7c4bd89cdd0d1e406e5cc1 (patch)
tree1089a663e360ced28033a587664073586c8c63e5 /src/qml/qml/v8/qv8bindings_p.h
parent833336fa963b3cd9f1996d7d255098f523dfa580 (diff)
Allow V8 bindings to be assigned to aliases
V8 bindings must be able to be retargetted for them to be assignable to aliases. Change-Id: If72ff2a24188667113cbb46439129f8d2fcb8f90 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/v8/qv8bindings_p.h')
-rw-r--r--src/qml/qml/v8/qv8bindings_p.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/qml/v8/qv8bindings_p.h b/src/qml/qml/v8/qv8bindings_p.h
index 8d27207a56..7cc1cc9c21 100644
--- a/src/qml/qml/v8/qv8bindings_p.h
+++ b/src/qml/qml/v8/qv8bindings_p.h
@@ -53,12 +53,13 @@
// We mean it.
//
+#include <private/qpointervaluepair_p.h>
#include <private/qqmlpropertycache_p.h>
#include <private/qqmlinstruction_p.h>
#include <private/qqmlexpression_p.h>
#include <private/qqmlcompiler_p.h>
-#include <private/qqmlbinding_p.h>
#include <private/qflagpointer_p.h>
+#include <private/qqmlbinding_p.h>
QT_BEGIN_HEADER
@@ -96,16 +97,22 @@ public:
virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags);
virtual void update(QQmlPropertyPrivate::WriteFlags flags);
virtual void destroy();
- virtual int propertyIndex() const;
virtual QObject *object() const;
+ virtual int propertyIndex() const;
+ virtual void retargetBinding(QObject *, int);
QV8Bindings *parent;
+ struct Retarget {
+ QObject *target;
+ int targetProperty;
+ };
+
// To save memory, we store flags inside the instruction pointer.
// target.flag1: destroyed
// instruction.flag1: enabled
// instruction.flag2: updating
- QFlagPointer<QObject> target;
+ QPointerValuePair<QObject, Retarget> target;
QFlagPointer<const QQmlInstruction::instr_assignBinding> instruction;
inline bool destroyedFlag() const { return target.flag(); }