MCPcopy Create free account
hub / github.com/KDAB/GammaRay / eventCallback

Function eventCallback

plugins/eventmonitor/eventmonitor.cpp:300–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300static bool eventCallback(void **data)
301{
302 QEvent *event = reinterpret_cast<QEvent *>(data[1]);
303 QObject *receiver = reinterpret_cast<QObject *>(data[0]);
304
305 if (!shouldBeRecorded(receiver, event))
306 return false;
307
308 EventData eventData = createEventData(receiver, event);
309
310 if (!event->spontaneous()
311 && isInputEvent(event->type())
312 && s_model->hasEvents()
313 && s_model->lastEvent().eventPtr == eventData.eventPtr
314 && s_model->lastEvent().type == event->type()) {
315 // this is an event propagated by a QQuickWindow to a child item:
316 s_model->lastEvent().propagatedEvents.append(eventData);
317 return false;
318 }
319
320 // add directly from foreground thread, delay from background thread
321 QMetaObject::invokeMethod(s_eventMonitor, "addEvent", Qt::AutoConnection, Q_ARG(GammaRay::EventData, eventData));
322 return false;
323}
324
325
326EventPropagationListener::EventPropagationListener(QObject *parent)

Callers

nothing calls this directly

Calls 6

shouldBeRecordedFunction · 0.85
createEventDataFunction · 0.85
isInputEventFunction · 0.85
hasEventsMethod · 0.80
appendMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected