diff options
-rw-r--r-- | src/qml/qml/qqmlabstractbinding_p.h | 5 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 5 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetypeproxybinding.cpp | 12 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetypeproxybinding_p.h | 4 |
5 files changed, 10 insertions, 18 deletions
diff --git a/src/qml/qml/qqmlabstractbinding_p.h b/src/qml/qml/qqmlabstractbinding_p.h index d4cb4e0e9e..aa76c9aeba 100644 --- a/src/qml/qml/qqmlabstractbinding_p.h +++ b/src/qml/qml/qqmlabstractbinding_p.h @@ -77,7 +77,7 @@ public: // Should return the object for the binding. Should return this object even if the // binding is not enabled or added to the object. - virtual QObject *targetObject() const = 0; + QObject *targetObject() const { return m_target.data(); } virtual void setEnabled(bool e, QQmlPropertyPrivate::WriteFlags f = QQmlPropertyPrivate::DontRemoveBinding) = 0; @@ -121,6 +121,9 @@ private: // This saves a compiler-generated pointer to a compiler-generated vTable, and thus reduces // the binding object size by sizeof(void*). qintptr m_nextBindingPtr; + +protected: + QFlagPointer<QObject> m_target; }; QQmlAbstractBinding::Pointer diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 24818cbcd1..ec9ac912b5 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -270,11 +270,6 @@ QString QQmlBinding::expression() const return v->toQStringNoThrow(); } -QObject *QQmlBinding::targetObject() const -{ - return *m_target; -} - int QQmlBinding::targetPropertyIndex() const { return m_index; diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 2d09c0fae9..69d434ab25 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -84,7 +84,6 @@ public: // Inherited from QQmlAbstractBinding virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags = QQmlPropertyPrivate::DontRemoveBinding); virtual QString expression() const; - virtual QObject *targetObject() const; virtual int targetPropertyIndex() const; void update(QQmlPropertyPrivate::WriteFlags flags = QQmlPropertyPrivate::DontRemoveBinding); @@ -107,7 +106,6 @@ private: inline void setEnabledFlag(bool); QQmlPropertyData getPropertyData() const; - QFlagPointer<QObject> m_target; int m_index; }; diff --git a/src/qml/qml/qqmlvaluetypeproxybinding.cpp b/src/qml/qml/qqmlvaluetypeproxybinding.cpp index f0457d25e3..a12699facf 100644 --- a/src/qml/qml/qqmlvaluetypeproxybinding.cpp +++ b/src/qml/qml/qqmlvaluetypeproxybinding.cpp @@ -36,8 +36,11 @@ QT_BEGIN_NAMESPACE QQmlValueTypeProxyBinding::QQmlValueTypeProxyBinding(QObject *o, int index) -: QQmlAbstractBinding(ValueTypeProxy), m_object(o), m_index(index), m_bindings(0) + : QQmlAbstractBinding(ValueTypeProxy), + m_targetIndex(index), + m_bindings(0) { + m_target = o; } QQmlValueTypeProxyBinding::~QQmlValueTypeProxyBinding() @@ -103,12 +106,7 @@ void QQmlValueTypeProxyBinding::removeBindings(quint32 mask) int QQmlValueTypeProxyBinding::targetPropertyIndex() const { - return m_index; -} - -QObject *QQmlValueTypeProxyBinding::targetObject() const -{ - return m_object; + return m_targetIndex; } QT_END_NAMESPACE diff --git a/src/qml/qml/qqmlvaluetypeproxybinding_p.h b/src/qml/qml/qqmlvaluetypeproxybinding_p.h index c73c944efd..6e618375d9 100644 --- a/src/qml/qml/qqmlvaluetypeproxybinding_p.h +++ b/src/qml/qml/qqmlvaluetypeproxybinding_p.h @@ -59,15 +59,13 @@ public: virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags); virtual int targetPropertyIndex() const; - virtual QObject *targetObject() const; protected: ~QQmlValueTypeProxyBinding(); private: friend class QQmlAbstractBinding; - QObject *m_object; - int m_index; + int m_targetIndex; QQmlAbstractBinding *m_bindings; }; |