7#include <QtCore/qdebug.h>
8#include <private/qthread_p.h>
32 struct NotifyListTraversalData {
34 : originalSenderPtr(0)
35 , disconnectWatch(
nullptr)
39 qintptr originalSenderPtr;
40 qintptr *disconnectWatch;
45void QQmlNotifier::notify(QQmlData *ddata,
int notifierIndex)
47 if (QQmlNotifierEndpoint *ep = ddata->notify(notifierIndex))
48 emitNotify(ep,
nullptr);
51void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint,
void **a)
53 QVarLengthArray<NotifyListTraversalData> stack;
55 stack.append(NotifyListTraversalData(endpoint));
56 endpoint = endpoint->next;
60 for (; i < stack.size(); ++i) {
61 NotifyListTraversalData &data = stack[i];
63 if (!data.endpoint->isNotifying()) {
64 data.endpoint->startNotifying(&data.originalSenderPtr);
65 data.disconnectWatch = &data.originalSenderPtr;
67 data.disconnectWatch = (qintptr *)(data.endpoint->senderPtr & ~0x1);
72 NotifyListTraversalData &data = stack[i];
73 if (*data.disconnectWatch) {
74 Q_ASSERT(QQmlNotifier_callbacks[data.endpoint->callback]);
75 QQmlNotifier_callbacks[data.endpoint->callback](data.endpoint, a);
76 if (data.disconnectWatch == &data.originalSenderPtr && data.originalSenderPtr) {
77 data.endpoint->stopNotifying(&data.originalSenderPtr);
84
85
86
92 if (QObjectPrivate::get(source)->threadData.loadRelaxed()->threadId.loadRelaxed() !=
93 QObjectPrivate::get(engine)->threadData.loadRelaxed()->threadId.loadRelaxed()) {
96 QDebug(&sourceName) << source;
97 sourceName = sourceName.left(sourceName.size() - 1);
99 QDebug(&engineName).nospace() << engine;
100 engineName = engineName.left(engineName.size() - 1);
102 qFatal(
"QQmlEngine: Illegal attempt to connect to %s that is in"
103 " a different thread than the QML engine %s.", qPrintable(sourceName),
104 qPrintable(engineName));
107 setSender(qintptr(source));
108 this->sourceSignal = sourceSignal;
109 QQmlPropertyPrivate::flushSignal(source, sourceSignal);
110 QQmlData *ddata = QQmlData::get(source,
true);
111 ddata->addNotify(sourceSignal,
this);
113 needsConnectNotify = doNotify;
114 QObjectPrivate *
const priv = QObjectPrivate::get(source);
115 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[]