Add a signal emitted callback to QAbstractDeclarativeData
For property notify signals, QtDeclarative can manage connections in a more special case - and more performant - way. This patch adds a callback hook so that QtDeclarative can intercept signals being emitted by declarative objects. Change-Id: I72554e80df0a4257da65d81cc1c5db88a11446a4 Reviewed-on: http://codereview.qt.nokia.com/3363 Reviewed-by: Martin Jones <martin.jones@nokia.com>
This commit is contained in:
parent
10eb62b71b
commit
009f3d1404
@ -147,6 +147,7 @@ private:
|
||||
void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0;
|
||||
void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0;
|
||||
void (*QAbstractDeclarativeData::objectNameChanged)(QAbstractDeclarativeData *, QObject *) = 0;
|
||||
void (*QAbstractDeclarativeData::signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **) = 0;
|
||||
|
||||
QObjectData::~QObjectData() {}
|
||||
|
||||
@ -3270,6 +3271,10 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
|
||||
|
||||
int signal_index = signalOffset + local_signal_index;
|
||||
|
||||
if (sender->d_func()->declarativeData && QAbstractDeclarativeData::signalEmitted)
|
||||
QAbstractDeclarativeData::signalEmitted(sender->d_func()->declarativeData, sender,
|
||||
methodOffset + local_signal_index, argv);
|
||||
|
||||
if (!sender->d_func()->isSignalConnected(signal_index))
|
||||
return; // nothing connected to these signals, and no spy
|
||||
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
static void (*destroyed)(QAbstractDeclarativeData *, QObject *);
|
||||
static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *);
|
||||
static void (*objectNameChanged)(QAbstractDeclarativeData *, QObject *);
|
||||
static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **);
|
||||
};
|
||||
|
||||
class Q_CORE_EXPORT QObjectPrivate : public QObjectData
|
||||
|
Loading…
Reference in New Issue
Block a user