aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-05-25 12:32:28 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-28 05:30:34 +0200
commitd4dad3a0b83c921ed4d746eb9694be8b008bcc1a (patch)
treef991d840d10a390d7937ae9769505bf45d1fe2c9 /tests/auto/quick
parent45931aac0cc9e251923453b980d6466028e908eb (diff)
Don't parent (QObject) delegate items to views.
This keeps object ownership within the context the items were created in and simplifies lifetime management as the VisualDataModel has sole license to delete objects and doesn't have to keep guards against a view and all it's children being deleted. Delegates are still reparented in the item heirarchy. Change-Id: Ife5afdfe294a5a8ca1ca3638a086f72452e4915c Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp2
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp2
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp6
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 828a10242b..04cc79de96 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -4264,7 +4264,7 @@ void tst_QQuickGridView::creationContext()
QVERIFY(rootItem->property("count").toInt() > 0);
QQuickItem *item;
- QVERIFY(item = rootItem->findChild<QQuickItem *>("listItem"));
+ QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem"));
QCOMPARE(item->property("text").toString(), QString("Hello!"));
QVERIFY(item = rootItem->findChild<QQuickItem *>("header"));
QCOMPARE(item->property("text").toString(), QString("Hello!"));
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index f24f91ccf6..2a674050a0 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -5002,7 +5002,7 @@ void tst_QQuickListView::creationContext()
QVERIFY(rootItem->property("count").toInt() > 0);
QQuickItem *item;
- QVERIFY(item = rootItem->findChild<QQuickItem *>("listItem"));
+ QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem"));
QCOMPARE(item->property("text").toString(), QString("Hello!"));
QVERIFY(item = rootItem->findChild<QQuickItem *>("header"));
QCOMPARE(item->property("text").toString(), QString("Hello!"));
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index ee0988f107..920db000ab 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -1480,13 +1480,13 @@ void tst_qquickpositioners::test_repeater()
{
QQuickView *canvas = createView(testFile("repeatertest.qml"));
- QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one");
+ QQuickRectangle *one = findItem<QQuickRectangle>(canvas->rootItem(), "one");
QVERIFY(one != 0);
- QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two");
+ QQuickRectangle *two = findItem<QQuickRectangle>(canvas->rootItem(), "two");
QVERIFY(two != 0);
- QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three");
+ QQuickRectangle *three = findItem<QQuickRectangle>(canvas->rootItem(), "three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 02b161830d..50c1e35b7e 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -3452,7 +3452,7 @@ void tst_qquickvisualdatamodel::invalidAttachment()
QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
QVERIFY(!property.value<QQuickVisualDataModel *>());
- QQuickItem *item = object->findChild<QQuickItem *>("delegate");
+ QQuickItem *item = findItem<QQuickItem>(static_cast<QQuickItem *>(object.data()), "delegate");
QVERIFY(item);
property = item->property("validVdm");