QQuickLoaderPrivate::~QQuickLoaderPrivate()
{
+ delete itemContext;
+ itemContext = 0;
delete incubator;
disposeInitialPropertyValues();
}
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;
}
QQml_setParent_noEvent(itemContext, obj);
QQml_setParent_noEvent(item, q);
item->setParentItem(q);
+ itemContext = 0;
}
if (initialPropertyValues.IsEmpty())
QVERIFY(!loader->item());
QCOMPARE(loader->status(), QQuickLoader::Loading);
- QCOMPARE(engine.incubationController()->incubatingObjectCount(), 1);
+ QTRY_COMPARE(engine.incubationController()->incubatingObjectCount(), 1);
// clear before component created
root->setProperty("comp", "");
QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0);
// check loading component
- root->setProperty("comp", "Rect120x60.qml");
+ root->setProperty("comp", "BigComponent.qml");
QMetaObject::invokeMethod(root, "loadComponent");
QVERIFY(!loader->item());
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(loader->status(), QQuickLoader::Ready);
QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1);
+
+ delete root;
}
void tst_QQuickLoader::simultaneousSyncAsync()