summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlexpression_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-20 06:06:19 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-20 08:33:23 (GMT)
commit86529642cfdc5cc5a94b735042d0807e3b57e9e1 (patch)
tree3df356de955a131abfed2c84db4f91abf639a583 /src/declarative/qml/qmlexpression_p.h
parent275d2a37c0c7179e7f34cc467192a8838705d7c2 (diff)
downloadQt-86529642cfdc5cc5a94b735042d0807e3b57e9e1.zip
Qt-86529642cfdc5cc5a94b735042d0807e3b57e9e1.tar.gz
Qt-86529642cfdc5cc5a94b735042d0807e3b57e9e1.tar.bz2
Rework expression stuff to use a more efficient notify handler
Diffstat (limited to 'src/declarative/qml/qmlexpression_p.h')
-rw-r--r--src/declarative/qml/qmlexpression_p.h81
1 files changed, 29 insertions, 52 deletions
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h
index 09745a3..41b7749 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qmlexpression_p.h
@@ -55,23 +55,24 @@
#include "qmlbasicscript_p.h"
#include "qmlexpression.h"
+#include "qmlengine_p.h"
+#include <private/qguard_p.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
class QmlExpression;
class QString;
-class QmlExpressionLog;
-class QmlExpressionBindProxy;
-class QmlExpressionPrivate
+class QmlExpressionPrivate : public QObjectPrivate
{
+ Q_DECLARE_PUBLIC(QmlExpression)
public:
- QmlExpressionPrivate(QmlExpression *);
- QmlExpressionPrivate(QmlExpression *, const QString &expr);
- QmlExpressionPrivate(QmlExpression *, void *expr, QmlRefCount *rc);
+ QmlExpressionPrivate();
~QmlExpressionPrivate();
- QmlExpression *q;
+ void init(QmlContext *, const QString &, QObject *);
+ void init(QmlContext *, void *, QmlRefCount *, QObject *);
+
QmlContext *ctxt;
QString expression;
bool expressionFunctionValid;
@@ -79,7 +80,6 @@ public:
QmlBasicScript sse;
void *sseData;
- QmlExpressionBindProxy *proxy;
QObject *me;
bool trackChange;
@@ -88,53 +88,30 @@ public:
quint32 id;
- void addLog(const QmlExpressionLog &);
- QList<QmlExpressionLog> *log;
-
QVariant evalSSE(QmlBasicScript::CacheState &cacheState);
QVariant evalQtScript();
-};
-
-class QmlExpressionBindProxy : public QObject
-{
-Q_OBJECT
-public:
- QmlExpressionBindProxy(QmlExpression *be)
- :e(be) { }
-
-private:
- QmlExpression *e;
-
-private Q_SLOTS:
- void changed() { e->valueChanged(); }
-};
-
-class QmlExpressionLog
-{
-public:
- QmlExpressionLog();
- QmlExpressionLog(const QmlExpressionLog &);
- ~QmlExpressionLog();
-
- QmlExpressionLog &operator=(const QmlExpressionLog &);
-
- void setTime(quint32);
- quint32 time() const;
-
- QString expression() const;
- void setExpression(const QString &);
-
- QStringList warnings() const;
- void addWarning(const QString &);
-
- QVariant result() const;
- void setResult(const QVariant &);
-private:
- quint32 m_time;
- QString m_expression;
- QVariant m_result;
- QStringList m_warnings;
+ struct SignalGuard : public QGuard<QObject> {
+ SignalGuard() : isDuplicate(false), notifyIndex(-1) {}
+
+ SignalGuard &operator=(QObject *obj) {
+ QGuard<QObject>::operator=(obj);
+ return *this;
+ }
+ SignalGuard &operator=(const SignalGuard &o) {
+ QGuard<QObject>::operator=(o);
+ isDuplicate = o.isDuplicate;
+ notifyIndex = o.notifyIndex;
+ return *this;
+ }
+
+ bool isDuplicate:1;
+ int notifyIndex:31;
+ };
+ SignalGuard *guardList;
+ int guardListLength;
+ void updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties);
+ void clearGuards();
};
QT_END_NAMESPACE