pre-condition: lock is held already, our thread
| 609 | |
| 610 | // pre-condition: lock is held already, our thread |
| 611 | void 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: |
no test coverage detected