From 9542511b013588b2ceb132ec8b34879ec904a21e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 23 Apr 2012 10:17:57 +1000 Subject: Support and use parameters in QQmlNotifierEndpoint. Allow QQmlNotifierEndpoint to support signals with parameters. Update QQmlBoundSignal to use this support. Change-Id: Ie2a245b39283b0b66d66bd2350e8bc85fe519bb5 Reviewed-by: Chris Adams --- src/qml/qml/qqmlboundsignal_p.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/qml/qml/qqmlboundsignal_p.h') diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h index c6ce875d07..e4115886ba 100644 --- a/src/qml/qml/qqmlboundsignal_p.h +++ b/src/qml/qml/qqmlboundsignal_p.h @@ -57,6 +57,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -109,6 +110,7 @@ public: virtual QQmlBoundSignalExpression *setExpression(QQmlBoundSignalExpression *) = 0; virtual QObject *scope() = 0; + void removeFromObject(); protected: void addToObject(QObject *owner); @@ -121,8 +123,8 @@ private: }; class QQmlBoundSignalParameters; -class Q_QML_EXPORT QQmlBoundSignal : public QObject, - public QQmlAbstractBoundSignal +class Q_QML_EXPORT QQmlBoundSignal : public QQmlAbstractBoundSignal, + public QQmlNotifierEndpoint { public: QQmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *owner); @@ -134,20 +136,20 @@ public: QQmlBoundSignalExpression *setExpression(QQmlBoundSignalExpression *); QObject *scope() { return m_scope; } - bool isEvaluating() const { return m_isEvaluating; } + static void subscriptionCallback(QQmlNotifierEndpoint *e, void **); -protected: - virtual int qt_metacall(QMetaObject::Call c, int id, void **a); + bool isEvaluating() const { return m_isEvaluating; } private: QQmlBoundSignalExpression *m_expression; QQmlBoundSignalParameters *m_params; QObject *m_scope; - QMetaMethod m_signal; + int m_index; bool m_paramsValid : 1; bool m_isEvaluating : 1; }; + QT_END_NAMESPACE #endif // QQMLBOUNDSIGNAL_P_H -- cgit v1.2.3