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

Method objectFullyConstructed

core/probe.cpp:611–643  ·  view source on GitHub ↗

pre-condition: lock is held already, our thread

Source from the content-addressed store, hash-verified

609
610// pre-condition: lock is held already, our thread
611void Probe::objectFullyConstructed(QObject *obj)
612{
613 Q_ASSERT(thread() == QThread::currentThread());
614
615 if (!m_validObjects.contains(obj)) {
616 // deleted already
617 IF_DEBUG(cout << "stale fully constructed: " << hex << obj << endl;)
618 return;
619 }
620
621 if (filterObject(obj)) {
622 // when the call was delayed from the ctor construction,
623 // the parent might not have been set properly yet. hence
624 // apply the filter again
625 m_validObjects.remove(obj);
626 IF_DEBUG(cout << "now filtered fully constructed: " << hex << obj << endl;)
627 return;
628 }
629
630 IF_DEBUG(cout << "fully constructed: " << hex << obj << endl;)
631
632 // ensure we know all our ancestors already
633 for (QObject *parent = obj->parent(); parent; parent = parent->parent()) {
634 if (!m_validObjects.contains(parent)) {
635 objectAdded(parent); // will also handle any further ancestors
636 break;
637 }
638 }
639 Q_ASSERT(!obj->parent() || m_validObjects.contains(obj->parent()));
640
641 m_toolManager->objectAdded(obj);
642 emit objectCreated(obj);
643}
644
645/*
646 * We have two cases to consider here:

Callers 1

objectAddedMethod · 0.80

Calls 3

removeMethod · 0.45
parentMethod · 0.45
objectAddedMethod · 0.45

Tested by

no test coverage detected