summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlexpression_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-08 03:25:56 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-08 03:25:56 (GMT)
commit41ec742f6713f5b3b4da853f514d685c35c3f31f (patch)
tree6088d2e80f64c80d2168a603fea28ab9ffb4efe3 /src/declarative/qml/qmlexpression_p.h
parent60a5afb67efcefa74cf452379dcef46b83daa265 (diff)
downloadQt-41ec742f6713f5b3b4da853f514d685c35c3f31f.zip
Qt-41ec742f6713f5b3b4da853f514d685c35c3f31f.tar.gz
Qt-41ec742f6713f5b3b4da853f514d685c35c3f31f.tar.bz2
Make qmlecmascript:selfDeletingBinding pass
Expressions and bindings must not reference data following their evalutation incase their object has been deleted. To solve this, the needed data is separated into a reference counted QmlExpressionData and QmlBindingData object.
Diffstat (limited to 'src/declarative/qml/qmlexpression_p.h')
-rw-r--r--src/declarative/qml/qmlexpression_p.h48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h
index 501e5d8..33016e6 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qmlexpression_p.h
@@ -79,23 +79,13 @@ private:
QmlAbstractExpression *m_nextExpression;
};
-class QmlExpression;
-class QString;
-class QmlExpressionPrivate : public QObjectPrivate, public QmlAbstractExpression
+class QmlExpressionData : public QmlAbstractExpression, public QmlRefCount
{
- Q_DECLARE_PUBLIC(QmlExpression)
public:
- QmlExpressionPrivate();
- ~QmlExpressionPrivate();
-
- enum CompiledDataType {
- BasicScriptEngineData = 1,
- PreTransformedQtScriptData = 2
- };
+ QmlExpressionData();
+ ~QmlExpressionData();
-
- void init(QmlContext *, const QString &, QObject *);
- void init(QmlContext *, void *, QmlRefCount *, QObject *);
+ QmlExpressionPrivate *q;
QString expression;
bool expressionFunctionValid:1;
@@ -109,10 +99,6 @@ public:
QString fileName;
int line;
- QVariant value(QObject *secondaryScope = 0);
- QVariant evalSSE();
- QVariant evalQtScript(QObject *secondaryScope);
-
struct SignalGuard : public QGuard<QObject> {
SignalGuard() : isDuplicate(false), notifyIndex(-1) {}
@@ -132,6 +118,32 @@ public:
};
SignalGuard *guardList;
int guardListLength;
+};
+
+class QmlExpression;
+class QString;
+class QmlExpressionPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QmlExpression)
+public:
+ QmlExpressionPrivate();
+ QmlExpressionPrivate(QmlExpressionData *);
+ ~QmlExpressionPrivate();
+
+ enum CompiledDataType {
+ BasicScriptEngineData = 1,
+ PreTransformedQtScriptData = 2
+ };
+
+ void init(QmlContext *, const QString &, QObject *);
+ void init(QmlContext *, void *, QmlRefCount *, QObject *);
+
+ QmlExpressionData *data;
+
+ QVariant value(QObject *secondaryScope = 0);
+ QVariant evalSSE();
+ QVariant evalQtScript(QObject *secondaryScope);
+
void updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties);
void clearGuards();