From d12c9306ee2355a76e3e037877ee445b31f66a23 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 May 2012 16:01:21 +0100 Subject: Use static dispatch tables for QQmlAbstractBinding This saves us the space of the virtual table pointer, but does somewhat limit us to the 4 QQmlAbstractBinding types that we have today. Change-Id: I03d06ef2ec0c51271c28e7a5aab6dc689d369da4 Reviewed-by: Roberto Raggi --- src/qml/qml/qqmlbinding_p.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/qml/qml/qqmlbinding_p.h') diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 2cf7b80290..bea74e43e2 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -97,13 +97,22 @@ public: // Inherited from QQmlAbstractExpression virtual void refresh(); - // Inherited from QQmlAbstractBinding - virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags); - virtual void update(QQmlPropertyPrivate::WriteFlags flags); - virtual QString expression() const; - virtual QObject *object() const; - virtual int propertyIndex() const; - virtual void retargetBinding(QObject *, int); + // "Inherited" from QQmlAbstractBinding + static QString expression(const QQmlAbstractBinding *); + static int propertyIndex(const QQmlAbstractBinding *); + static QObject *object(const QQmlAbstractBinding *); + static void setEnabled(QQmlAbstractBinding *, bool, QQmlPropertyPrivate::WriteFlags); + static void update(QQmlAbstractBinding *, QQmlPropertyPrivate::WriteFlags); + static void retargetBinding(QQmlAbstractBinding *, QObject *, int); + + void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags); + void update(QQmlPropertyPrivate::WriteFlags flags); + void update() { update(QQmlPropertyPrivate::DontRemoveBinding); } + + QString expression() const; + QObject *object() const; + int propertyIndex() const; + void retargetBinding(QObject *, int); typedef int Identifier; static Identifier Invalid; @@ -111,12 +120,12 @@ public: static QQmlBinding *createBinding(Identifier, QObject *, QQmlContext *, const QString &, int); QVariant evaluate(); - void update() { update(QQmlPropertyPrivate::DontRemoveBinding); } static QString expressionIdentifier(QQmlJavaScriptExpression *); static void expressionChanged(QQmlJavaScriptExpression *); protected: + friend class QQmlAbstractBinding; ~QQmlBinding(); private: -- cgit v1.2.3