void asynchronous();
void asynchronous_clear();
+ void parented();
+
private:
QDeclarativeEngine engine;
};
QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1);
}
+void tst_QQuickLoader::parented()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("parented.qml"));
+ QQuickItem *root = qobject_cast<QQuickItem*>(component.create());
+ QVERIFY(root);
+
+ QQuickItem *item = root->findChild<QQuickItem*>("comp");
+ QVERIFY(item);
+
+ QVERIFY(item->parentItem() == root);
+
+ QCOMPARE(item->width(), 300.);
+ QCOMPARE(item->height(), 300.);
+
+ delete root;
+}
+
QTEST_MAIN(tst_QQuickLoader)