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

Method processQueuedObjectChanges

core/probe.cpp:574–608  ·  view source on GitHub ↗

pre-conditions: lock may or may not be held already, our thread

Source from the content-addressed store, hash-verified

572
573// pre-conditions: lock may or may not be held already, our thread
574void Probe::processQueuedObjectChanges()
575{
576 QMutexLocker lock(s_lock());
577
578 IF_DEBUG(cout << Q_FUNC_INFO << " " << m_queuedObjectChanges.size() << endl;)
579
580 // must be called from the main thread via timeout
581 Q_ASSERT(QThread::currentThread() == thread());
582
583 const auto queuedObjectChanges = m_queuedObjectChanges; // copy, in case this gets modified while we iterate (which can actually happen)
584 for (const auto &change : queuedObjectChanges) {
585 switch (change.type) {
586 case ObjectChange::Create:
587 objectFullyConstructed(change.obj);
588 break;
589 case ObjectChange::Destroy:
590 emit objectDestroyed(change.obj);
591 break;
592 }
593 }
594
595 IF_DEBUG(cout << Q_FUNC_INFO << " done" << endl;)
596
597 m_queuedObjectChanges.clear();
598
599 for (QObject *obj : std::as_const(m_pendingReparents)) {
600 if (!isValidObject(obj))
601 continue;
602 if (filterObject(obj)) // the move might have put it under a hidden parent
603 objectRemoved(obj);
604 else
605 emit objectReparented(obj);
606 }
607 m_pendingReparents.clear();
608}
609
610// pre-condition: lock is held already, our thread
611void Probe::objectFullyConstructed(QObject *obj)

Callers

nothing calls this directly

Calls 3

isValidObjectFunction · 0.85
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected