6#include <QtCore/qdebug.h>
7#include <private/qthread_p.h>
31 struct NotifyListTraversalData {
33 : originalSenderPtr(0)
34 , disconnectWatch(
nullptr)
38 qintptr originalSenderPtr;
39 qintptr *disconnectWatch;
44void QQmlNotifier::notify(QQmlData *ddata,
int notifierIndex)
46 if (QQmlNotifierEndpoint *ep = ddata->notify(notifierIndex))
47 emitNotify(ep,
nullptr);
50void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint,
void **a)
52 QVarLengthArray<NotifyListTraversalData> stack;
54 stack.append(NotifyListTraversalData(endpoint));
55 endpoint = endpoint->next;
59 for (; i < stack.size(); ++i) {
60 NotifyListTraversalData &data = stack[i];
62 if (!data.endpoint->isNotifying()) {
63 data.endpoint->startNotifying(&data.originalSenderPtr);
64 data.disconnectWatch = &data.originalSenderPtr;
66 data.disconnectWatch = (qintptr *)(data.endpoint->senderPtr & ~0x1);
71 NotifyListTraversalData &data = stack[i];
72 if (*data.disconnectWatch) {
73 Q_ASSERT(QQmlNotifier_callbacks[data.endpoint->callback]);
74 QQmlNotifier_callbacks[data.endpoint->callback](data.endpoint, a);
75 if (data.disconnectWatch == &data.originalSenderPtr && data.originalSenderPtr) {
76 data.endpoint->stopNotifying(&data.originalSenderPtr);
83
84
85
91 if (QObjectPrivate::get(source)->threadData.loadRelaxed()->threadId.loadRelaxed() !=
92 QObjectPrivate::get(engine)->threadData.loadRelaxed()->threadId.loadRelaxed()) {
95 QDebug(&sourceName) << source;
96 sourceName = sourceName.left(sourceName.size() - 1);
98 QDebug(&engineName).nospace() << engine;
99 engineName = engineName.left(engineName.size() - 1);
101 qFatal(
"QQmlEngine: Illegal attempt to connect to %s that is in"
102 " a different thread than the QML engine %s.", qPrintable(sourceName),
103 qPrintable(engineName));
106 setSender(qintptr(source));
107 this->sourceSignal = sourceSignal;
108 QQmlPropertyPrivate::flushSignal(source, sourceSignal);
109 QQmlData *ddata = QQmlData::get(source,
true);
110 ddata->addNotify(sourceSignal,
this);
112 needsConnectNotify = doNotify;
113 QObjectPrivate *
const priv = QObjectPrivate::get(source);
114 priv->connectNotify(QMetaObjectPrivate::signal(source->metaObject(), sourceSignal));
Combined button and popup list for selecting options.
void QQmlUnbindableToUnbindableGuard_callback(QQmlNotifierEndpoint *, void **)
void QQmlVMEMetaObjectEndpoint_callback(QQmlNotifierEndpoint *, void **)
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *, void **)
void QQmlUnbindableToBindableGuard_callback(QQmlNotifierEndpoint *, void **)
QT_BEGIN_NAMESPACE typedef void(* Callback)(QQmlNotifierEndpoint *, void **)
void QQmlDirtyReferenceObject_callback(QQmlNotifierEndpoint *, void **)
void QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint *, void **)
static Callback QQmlNotifier_callbacks[]