Change internal QDeclarativeData hooks to use signal index range
This also changes the qtdeclarative-specific QMetaObject::activate() overload to not take a methodOffset argument, since it's no longer needed. Change-Id: I4f7ece9f43339f3327419598c032e48fb37b97f0 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
This commit is contained in:
parent
69478da0f0
commit
c66dc44968
@ -2184,7 +2184,7 @@ int QObject::receivers(const char *signal) const
|
|||||||
|
|
||||||
if (d->declarativeData && QAbstractDeclarativeData::receivers) {
|
if (d->declarativeData && QAbstractDeclarativeData::receivers) {
|
||||||
receivers += QAbstractDeclarativeData::receivers(d->declarativeData, this,
|
receivers += QAbstractDeclarativeData::receivers(d->declarativeData, this,
|
||||||
metaObject()->indexOfMethod(signal));
|
signal_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!d->isSignalConnected(signal_index))
|
if (!d->isSignalConnected(signal_index))
|
||||||
@ -3276,22 +3276,18 @@ static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connect
|
|||||||
void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index,
|
void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index,
|
||||||
void **argv)
|
void **argv)
|
||||||
{
|
{
|
||||||
int signalOffset;
|
activate(sender, QMetaObjectPrivate::signalOffset(m), local_signal_index, argv);
|
||||||
int methodOffset;
|
|
||||||
computeOffsets(m, &signalOffset, &methodOffset);
|
|
||||||
activate(sender, methodOffset, signalOffset, local_signal_index, argv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!\internal
|
/*!\internal
|
||||||
*/
|
*/
|
||||||
void QMetaObject::activate(QObject *sender, int methodOffset, int signalOffset, int local_signal_index,
|
void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_index, void **argv)
|
||||||
void **argv)
|
|
||||||
{
|
{
|
||||||
int signal_index = signalOffset + local_signal_index;
|
int signal_index = signalOffset + local_signal_index;
|
||||||
|
|
||||||
if (sender->d_func()->declarativeData && QAbstractDeclarativeData::signalEmitted)
|
if (sender->d_func()->declarativeData && QAbstractDeclarativeData::signalEmitted)
|
||||||
QAbstractDeclarativeData::signalEmitted(sender->d_func()->declarativeData, sender,
|
QAbstractDeclarativeData::signalEmitted(sender->d_func()->declarativeData, sender,
|
||||||
methodOffset + local_signal_index, argv);
|
signal_index, argv);
|
||||||
|
|
||||||
if (!sender->d_func()->isSignalConnected(signal_index))
|
if (!sender->d_func()->isSignalConnected(signal_index))
|
||||||
return; // nothing connected to these signals, and no spy
|
return; // nothing connected to these signals, and no spy
|
||||||
|
@ -348,7 +348,7 @@ struct Q_CORE_EXPORT QMetaObject
|
|||||||
// internal index-based signal activation
|
// internal index-based signal activation
|
||||||
static void activate(QObject *sender, int signal_index, void **argv);
|
static void activate(QObject *sender, int signal_index, void **argv);
|
||||||
static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
|
static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
|
||||||
static void activate(QObject *sender, int method_offset, int signal_offset, int local_signal_index, void **argv);
|
static void activate(QObject *sender, int signal_offset, int local_signal_index, void **argv);
|
||||||
|
|
||||||
static bool invokeMethod(QObject *obj, const char *member,
|
static bool invokeMethod(QObject *obj, const char *member,
|
||||||
Qt::ConnectionType,
|
Qt::ConnectionType,
|
||||||
|
Loading…
Reference in New Issue
Block a user