void QDeclarativeLoaderPrivate::load() { Q_Q(QDeclarativeLoader); if (!q->isComponentComplete() || !component) return; if (!component->isLoading()) { _q_sourceLoaded(); } else { QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), q, SLOT(_q_sourceLoaded())); QObject::connect(component, SIGNAL(progressChanged(qreal)), q, SIGNAL(progressChanged())); emit q->statusChanged(); emit q->progressChanged(); emit q->sourceChanged(); emit q->itemChanged(); } }
void QQuickLoaderPrivate::clear() { Q_Q(QQuickLoader); disposeInitialPropertyValues(); if (incubator) incubator->clear(); delete itemContext; itemContext = 0; if (loadingFromSource && component) { // disconnect since we deleteLater QObject::disconnect(component, SIGNAL(statusChanged(QQmlComponent::Status)), q, SLOT(_q_sourceLoaded())); QObject::disconnect(component, SIGNAL(progressChanged(qreal)), q, SIGNAL(progressChanged())); component->deleteLater(); component = 0; } componentStrongReference.clear(); source = QUrl(); if (item) { QQuickItemPrivate *p = QQuickItemPrivate::get(item); p->removeItemChangeListener(this, watchedChanges); // We can't delete immediately because our item may have triggered // the Loader to load a different item. item->setParentItem(0); item->setVisible(false); item = 0; } if (object) { object->deleteLater(); object = 0; } }